codeceptjs 4.0.2-beta.8 → 4.0.2-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,14 +19,25 @@ const stderr = ''
19
19
 
20
20
  const { options, tests, testRoot, workerIndex, poolMode } = workerData
21
21
 
22
- // Global error handlers to prevent worker from hanging
22
+ // Global error handlers to catch critical errors but not test failures
23
23
  process.on('uncaughtException', (err) => {
24
+ // Don't exit on test assertion errors - those are handled by mocha
25
+ if (err.name === 'AssertionError' || err.message?.includes('expected')) {
26
+ console.error(`[Worker ${workerIndex}] Test assertion error (handled by mocha):`, err.message)
27
+ return
28
+ }
24
29
  console.error(`[Worker ${workerIndex}] Uncaught exception:`, err.message)
25
30
  console.error(err.stack)
26
31
  process.exit(1)
27
32
  })
28
33
 
29
34
  process.on('unhandledRejection', (reason, promise) => {
35
+ // Don't exit on test-related rejections
36
+ const msg = reason?.message || String(reason)
37
+ if (msg.includes('expected') || msg.includes('AssertionError')) {
38
+ console.error(`[Worker ${workerIndex}] Test rejection (handled by mocha):`, msg)
39
+ return
40
+ }
30
41
  console.error(`[Worker ${workerIndex}] Unhandled rejection:`, reason)
31
42
  process.exit(1)
32
43
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeceptjs",
3
- "version": "4.0.2-beta.8",
3
+ "version": "4.0.2-beta.9",
4
4
  "type": "module",
5
5
  "description": "Supercharged End 2 End Testing Framework for NodeJS",
6
6
  "keywords": [