Skip to content

didil/serverless-testing-examples

Repository files navigation

Serverless Testing Examples

Codeship Status for didil/serverless-testing-examples

This repository illustrates some strategies to test apps built using Serverless framework.

I've published an article about this on Medium: Serverless Testing Strategies

Setup

  • Install Node 8.10 (latest runtime supported by AWS Lambda)

  • Install serverless (tested against serverless v1.28.0)

$ npm i -g serverless 
  • Install node modules
$ npm i 
  • Initialize env variables file
$ touch env.yml 
  • Run tests
$ npm test

Running locally

  • Start serverless offline
$ sls offline
  • Send an http request with httpie
$ http :3000/asyncConcat a==foo b==bar

HTTP/1.1 200 OK
Connection: keep-alive
Date: Mon, 16 Jul 2018 12:20:24 GMT
Transfer-Encoding: chunked
access-control-allow-credentials: true
access-control-allow-origin: *
cache-control: no-cache
content-encoding: gzip
content-type: application/json; charset=utf-8
vary: origin,accept-encoding

{
    "result": "foo bar"
}



Contributions

If you would like to contribute to this repo and share some interesting test scenarios/usages with the serverless community, please feel free to open a PR !

You can reach me on Twitter: @le_didil

About

Serverless Testing Examples

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published