AWS Lambda mock context object
$ npm install --save-dev aws-lambda-mock-context
const context = require('aws-lambda-mock-context');
const ctx = context();
index.handler({hello: 'world'}, ctx);
ctx.Promise
.then(() => {
//=> succeed() called
})
.catch(err => {
//=> fail() called
});
Type: string
Default: us-west-1
AWS region.
Type: string
Default: 123456789012
Account number.
Type: string
Default: aws-lambda-mock-context
Name of the function.
Type: string
Default: $LATEST
Version of the function.
Type: string
Default: 128
Memory limit.
Type: string
Alias of the function.
Type: number
Default: 3
Timeout of the lambda function in seconds.
- aws-lambda-pify - Promisify an AWS lambda function.
MIT © Sam Verschueren