Fix non-deterministic erros in testing

Without the `--runInBand` flag, jest will create a worker pool of child
processes and run the tests withing. No surprise, why the tests were
running completely non-deterministically! If we clear the database in
the middle of the tests we will end up with no records, or if we run the
factories in several tests we end up with many duplicate records.

FYI: @mattwr18 @appinteractive @tansaku @Kachulio1
This commit is contained in:
Robert Schäfer 2019-01-14 23:22:12 +01:00
parent 70b20302fe
commit 6f487e2687

View File

@ -14,7 +14,7 @@
"lint": "eslint src --config .eslintrc.js",
"test": "nyc --reporter=text-lcov yarn run test:jest",
"test:jest": "$npm_package_config_no_auth run-p --race start test:cmd:jest",
"test:cmd:jest": "jest --forceExit --detectOpenHandles",
"test:cmd:jest": "jest --forceExit --detectOpenHandles --runInBand",
"test:coverage": "nyc report --reporter=text-lcov > coverage.lcov",
"db:script:seed": "wait-on tcp:4001 && babel-node src/seed/seed-db.js",
"db:script:reset": "wait-on tcp:4001 && babel-node src/seed/reset-db.js",