Skip to content

Commit

Permalink
switch integration tests to typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
aoskotsky-amplify committed May 14, 2020
1 parent e648641 commit 99f2b48
Show file tree
Hide file tree
Showing 9 changed files with 270 additions and 245 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -170,7 +170,7 @@ npm install
```

## Writing Integration Tests
Unit tests are found in `test/unit-tests`. Integration tests are found in `test/integration-tests`. Each folder in `tests/integration-tests` contains the serverless-domain-manager configuration being tested. To create a new integration test, create a new folder for the `handler.js` and `serverless.yml` with the same naming convention and update `integration.test.js`.
Unit tests are found in `test/unit-tests`. Integration tests are found in `test/integration-tests`. Each folder in `tests/integration-tests` contains the serverless-domain-manager configuration being tested. To create a new integration test, create a new folder for the `handler.js` and `serverless.yml` with the same naming convention and update `integration.test.ts`.

## Changing API Types
AWS API Gateway has three different API types: REST, HTTP, and WebSocket. Special steps need to be taken when migrating from one api type to another. A common migration will be from a REST API to an HTTP API given the potential cost savings. Below are the steps required to change from REST to HTTP. A similar process can be applied for other API type migrations.
Expand Down
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -27,9 +27,9 @@
"main": "dist/index.js",
"bin": {},
"scripts": {
"test": "tsc --project . && nyc mocha -r ts-node/register test/unit-tests/index.test.ts && nyc report --reporter=text-summary",
"integration-test": "node ./node_modules/istanbul/lib/cli.js test _mocha test/integration-tests -- -R spec",
"lint": "tslint --project .",
"test": "nyc mocha -r ts-node/register --project tsconfig.tests.json test/unit-tests/index.test.ts && nyc report --reporter=text-summary",
"integration-test": "nyc mocha -r ts-node/register --project tsconfig.tests.json test/integration-tests/integration.test.ts && nyc report --reporter=text-summary",
"lint": "tslint --project . && tslint --project tsconfig.tests.json",
"build": "tsc --project ."
},
"files": [
Expand Down
223 changes: 0 additions & 223 deletions test/integration-tests/integration.test.js

This file was deleted.

0 comments on commit 99f2b48

Please sign in to comment.