Skip to content

Commit

Permalink
chore: Drop and create test database automatically between runs
Browse files Browse the repository at this point in the history
docs: Update README to specify using make to run tests
  • Loading branch information
tommoor committed Nov 12, 2020
1 parent 80d74c9 commit a94012a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@ build:

test:
docker-compose up -d redis postgres s3
yarn sequelize db:drop --env=test
yarn sequelize db:create --env=test
yarn sequelize db:migrate --env=test
yarn test

watch:
docker-compose up -d redis postgres s3
yarn sequelize db:drop --env=test
yarn sequelize db:create --env=test
yarn sequelize db:migrate --env=test
yarn test:watch

destroy:
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,16 @@ To add new tests, write your tests with [Jest](https://facebook.github.io/jest/)

```shell
# To run all tests
yarn test
make test

# To run backend tests in watch mode
make watch
```

Once the test database is created with `make test` you may individually run
frontend and backend tests directly.

```shell
# To run backend tests
yarn test:server

Expand Down

0 comments on commit a94012a

Please sign in to comment.