An open API service indexing awesome lists of open source software.

https://github.com/oieduardorabelo/2021-03-20-express-serverless-e2e

Express.js with Serverless Framework and End-to-End (E2E) testing with Supertest
https://github.com/oieduardorabelo/2021-03-20-express-serverless-e2e

Last synced: about 1 month ago
JSON representation

Express.js with Serverless Framework and End-to-End (E2E) testing with Supertest

Awesome Lists containing this project

README

        

Serverless Express.js setup with Serverless Framework and End-to-End (E2E) testing with Supertest

- Express.js with serverless-http
- Amazon Cognito
- End-to-End (E2E) testing with Supertest

To deploy:

```bash
# aws credentials/profiles are located at "~/.aws/credentials"
npm install
AWS_PROFILE= npm run sls:deploy
```

Export AWS environment variables to `.env` to be used by your tests:

```bash
AWS_PROFILE= sls:export-env
```

Run End-to-End (E2E) tests:

```bash
AWS_PROFILE= npm run test:e2e
```

**NOTE:** You don't need to set `AWS_PROFILE` every time. If you have the correct credentials globally in your terminal session, you can ignore/remove it.