Skip to content

Commit c7e5ff6

Browse files
committed
fix: stop tests from hanging CI (mocha --exit)
Importing the app's modules in tests transitively runs app() (Fastify listen + scheduler crons), which keeps the Node event loop alive so mocha never exits. The CI 'Run tests' step therefore hung until the 6h timeout and was cancelled, so the push-on-production deploy job NEVER ran - no code had deployed for days (this is why the meteo-alerts fixes appeared to have no effect). Add --exit so mocha terminates after the run and the pipeline can reach the deploy step.
1 parent d786137 commit c7e5ff6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"scripts": {
77
"start": "nodemon src/index.ts",
88
"dist": "tsc",
9-
"test": "NODE_ENV=test mocha --require ts-node/register --extension ts --spec './tests/**/*.ts'",
9+
"test": "NODE_ENV=test mocha --require ts-node/register --extension ts --exit --spec './tests/**/*.ts'",
1010
"deploy": "docker compose build --no-cache && docker compose up -d --force-recreate"
1111
},
1212
"dependencies": {

0 commit comments

Comments
 (0)