Skip to content

Commit 430b0ee

Browse files
committed
test(backend): run jest without Sparkplug to avoid a Node 24 crash
Node 24 has a V8 garbage collector bug (nodejs/node#62393) that kills a jest worker with SIGSEGV about once in ten full runs, and jest reports whichever suite was running as failed. The test scripts start jest with node --no-sparkplug, which the workers inherit. Node 22, used by CI and production, is not affected. Drop the flag once a Node 24 release ships the fix. test:debug now points at jest's JS entry, so it also works under pnpm.
1 parent fc81744 commit 430b0ee

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎apps/backend/package.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
"start:prod": "node dist/main",
1515
"lint": "oxlint src test && prettier --check \"src/**/*.ts\" \"test/**/*.ts\"",
1616
"check": "tsc --noEmit",
17-
"test": "jest",
18-
"test:watch": "jest --watch",
19-
"test:cov": "jest --coverage",
20-
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
17+
"test": "node --no-sparkplug node_modules/jest/bin/jest.js",
18+
"test:watch": "node --no-sparkplug node_modules/jest/bin/jest.js --watch",
19+
"test:cov": "node --no-sparkplug node_modules/jest/bin/jest.js --coverage",
20+
"test:debug": "node --no-sparkplug --inspect-brk node_modules/jest/bin/jest.js --runInBand",
2121
"stripe": "stripe listen --forward-to localhost:3000/payments/stripe/webhook",
2222
"migrate-up": "npx migrate-mongo up",
2323
"migrate-clickhouse": "dotenv -e .env -- clickhouse-migrations migrate"

0 commit comments

Comments
 (0)