Skip to content

Commit a94012a

Browse files
committed
chore: Drop and create test database automatically between runs
docs: Update README to specify using make to run tests
1 parent 80d74c9 commit a94012a

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

Makefile

+6
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,16 @@ build:
99

1010
test:
1111
docker-compose up -d redis postgres s3
12+
yarn sequelize db:drop --env=test
13+
yarn sequelize db:create --env=test
14+
yarn sequelize db:migrate --env=test
1215
yarn test
1316

1417
watch:
1518
docker-compose up -d redis postgres s3
19+
yarn sequelize db:drop --env=test
20+
yarn sequelize db:create --env=test
21+
yarn sequelize db:migrate --env=test
1622
yarn test:watch
1723

1824
destroy:

README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,16 @@ To add new tests, write your tests with [Jest](https://facebook.github.io/jest/)
139139

140140
```shell
141141
# To run all tests
142-
yarn test
142+
make test
143143

144+
# To run backend tests in watch mode
145+
make watch
146+
```
147+
148+
Once the test database is created with `make test` you may individually run
149+
frontend and backend tests directly.
150+
151+
```shell
144152
# To run backend tests
145153
yarn test:server
146154

0 commit comments

Comments
 (0)