Commit 68231af
committed
fix: set exit code when tests fail
The mocha.run() callback receives a 'failures' count parameter that indicates how many tests failed, but this was not being used to set process.exitCode. This caused the process to exit with code 0 even when tests failed, making CI pipelines incorrectly report success.
Changes:
- Accept failures parameter in mocha.run() callback
- Pass failures to done() function
- Set process.exitCode = 1 when failures > 0
- Ensures CI pipelines correctly fail when tests fail1 parent a159d02 commit 68231af
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
272 | | - | |
| 272 | + | |
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
277 | 281 | | |
278 | 282 | | |
279 | 283 | | |
280 | 284 | | |
281 | 285 | | |
282 | | - | |
| 286 | + | |
283 | 287 | | |
284 | 288 | | |
285 | 289 | | |
| |||
0 commit comments