Skip to content

jeffcarp/test-lambda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

test-lambda

AWS Lambda is really cool, but you know what's also cool? Tests. This is a module for unit testing Lambda functions. It should work with Mocha, Jasmine, Tape, or whatever test framework you use.

🚨 Status: OK for basic tests. Also attempts to mock dynamodb-doc but it's not a complete feature.

var assert = require('assert')
var testMyLambda = require('test-lambda').test(path.resolve('./path/to/your/lambda/index.js'))

it('returns something', function (done) {
  testMyLambda({
    operation: 'get',
    id: 'an-id',
  }, function (status, data) {
    assert(status === 'succeed')
    done()
  })
})

Install

npm install test-lambda

About

Unit test AWS Lambda functions

Resources

License

Stars

Watchers

Forks

Packages

No packages published