You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Locally invoke Serverless functions via their HTTP event as specified in Serverless.yml.
It makes it easy to test not only your handler logic, but also ensures that you have your http events setup properly in serverless.yml without deploying.
Use it in tests of Serverless functions to test your HTTP endpoints along with the handler code. For example, you can write the following to test a Serverless function:
it('should invoke simple path', function () {
let response = invoker.invoke('GET api/hello')
return expect(response).to.eventually.have.property('statusCode', 200)
})
The test above is a test of a Serverless function defined in a Serverless.yml as follows:
Some of the more common use cases are demonstrated in the basic tests at the basic test cases.
An exhaustive list of what is supported in Some of the more common use cases are demonstrated in the basic tests at the comprehensive test cases.
Tests the serverless route is configured in serverless.yml as well as your handler code
Test Framework agnostic (mocha, jest, etc.)
Contributing ๐ค
This is a community project. We invite your participation through issues and pull requests! You can peruse the contributing guidelines.
Show your support
Give a โญ๏ธ if this project helped you!
Release Process (Deploying to NPM)
We use semantic-release to consistently release semver-compatible versions. This project deploys to multiple npm distribution tags. Each of the below branches correspond to the following npm distribution tags: