Skip to content

Commit

Permalink
Document the test scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
amazon-meaisiah committed Jun 5, 2020
1 parent 136b8ad commit 576c036
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- [Node](https://nodejs.org/en/download/) v12 or later
- [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html)
- [AWS SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html)
- [CloudFormation Linter](https://github.com/aws-cloudformation/cfn-python-lint)
- [CloudFormation Linter (`cfn-lint`)](https://github.com/aws-cloudformation/cfn-python-lint)

2. Clone this repo to your local drive.

Expand Down Expand Up @@ -181,6 +181,29 @@ Synonymous with `node run build deploy reset-assets`, as that's a common operati

Gets the output from the CFN stack, writes a local version of the config.js file, and starts up the local development server.

### `node run lint`

Lint all code in the repo using ESLint and `cfn-lint`.

### `node run test`

Run all the unit tests.

### `node run test --coverage=true`

Run all the unit tests with coverage.

### `node run test --integ=true`

Run all the integration tests.

## Notes on testing

If you need to run the unit tests with a debugger, you'll need to run them manually using the relevant test runners.

- For the unit tests in `dev-portal/`, run `npx react-scripts --inspect-brk test --runInBand --no-cache` in that directory.
- For the unit tests in `lambdas/`, run `npx --inspect-brk jest --runInBand --no-cache` in that directory.

## Notes on static assets

The static assets are only re-uploaded on deployment if the previous deployment and the current deployment were provided different `StaticAssetRebuildToken` parameters. The `node run deploy` script automatically creates a unique `StaticAssetRebuildToken` for you based on the current date, so it updates on every deployment.

0 comments on commit 576c036

Please sign in to comment.