From a94012a03ad6e26c802e0fa1119509fe54c8288b Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 11 Nov 2020 16:58:45 -0800 Subject: [PATCH] chore: Drop and create test database automatically between runs docs: Update README to specify using make to run tests --- Makefile | 6 ++++++ README.md | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ee874f9a7..a10b9261f 100644 --- a/Makefile +++ b/Makefile @@ -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: diff --git a/README.md b/README.md index bae6a2068..1210f3245 100644 --- a/README.md +++ b/README.md @@ -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