Skip to content

Commit 403c142

Browse files
fix: run tests sequentially to fix CI timeout on integration suites
Integration tests each call bootstrap() (MongoDB + Express) in beforeAll. Running in parallel on CI hardware causes 5s hook timeouts. - Add --runInBand to all test scripts (matches previous gulp sequential behavior) - Increase testTimeout to 15000ms for slower CI environments
1 parent fa139ed commit 403c142

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

jest.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ export default {
133133
// The test environment that will be used for testing
134134
testEnvironment: 'node',
135135

136+
// Global timeout for tests and hooks (integration tests bootstrap MongoDB + Express)
137+
testTimeout: 15000,
138+
136139
// Options that will be passed to the testEnvironment
137140
// testEnvironmentOptions: {},
138141

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
"start": "node server.js",
2727
"debug": "nodemon --inspect server.js",
2828
"prod": "cross-env NODE_ENV=production node start server.js --name=node",
29-
"test": "cross-env NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest",
30-
"test:watch": "cross-env NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest --watch",
31-
"test:coverage": "cross-env NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest --coverage",
32-
"test:coveralls": "cross-env NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest --coverage && cat ./coverage/lcov.info | coveralls",
29+
"test": "cross-env NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest --runInBand",
30+
"test:watch": "cross-env NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest --watch --runInBand",
31+
"test:coverage": "cross-env NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest --coverage --runInBand",
32+
"test:coveralls": "cross-env NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest --coverage --runInBand && cat ./coverage/lcov.info | coveralls",
3333
"lint": "./node_modules/.bin/eslint ./modules ./lib ./config ./scripts",
3434
"seed:dev": "cross-env NODE_ENV=development gulp seed",
3535
"seed:prod": "cross-env NODE_ENV=production gulp seed",

0 commit comments

Comments
 (0)