chore: Drop and create test database automatically between runs
docs: Update README to specify using make to run tests
This commit is contained in:
6
Makefile
6
Makefile
@@ -9,10 +9,16 @@ build:
|
|||||||
|
|
||||||
test:
|
test:
|
||||||
docker-compose up -d redis postgres s3
|
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
|
yarn test
|
||||||
|
|
||||||
watch:
|
watch:
|
||||||
docker-compose up -d redis postgres s3
|
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
|
yarn test:watch
|
||||||
|
|
||||||
destroy:
|
destroy:
|
||||||
|
|||||||
10
README.md
10
README.md
@@ -139,8 +139,16 @@ To add new tests, write your tests with [Jest](https://facebook.github.io/jest/)
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
# To run all tests
|
# 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
|
# To run backend tests
|
||||||
yarn test:server
|
yarn test:server
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user