0.0.7 • Published 10 years ago

azure-function-context-mock v0.0.7

Weekly downloads
209
License
MIT
Repository
github
Last release
10 years ago

npm version Build Status

azure-function-context-mock

Simple object to mock context in tests when use Function App from Azure.

Install

$ npm install --save-dev azure-function-context-mock

Usage

This example use Mocha but feel free to use your favorite test framework 😄

var context = require('azure-function-context-mock');

describe('my awsome tests', function () {
    it('Yes, I have a context!', function (done) {
        return myFunction(context)
            .then(done);
    });
});

Context Object

done => Promise

Returns a Promise with a object with properties res and bindings to you can know when the function finishes in your test and ensure your output.

log => void

Execute console.log to facilitate yours logs outside Azure.

bindings => Object

Just a empty object to you can set any binding and it's not undefined.

res => Object

Default res object with status 200 and body string empty.

To more information about context access Azure docs.

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago