codeceptjs 4.0.2-beta.12 → 4.0.2-beta.13
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.
- package/lib/command/workers/runTests.js +15 -10
- package/package.json +1 -1
|
@@ -21,24 +21,29 @@ const { options, tests, testRoot, workerIndex, poolMode } = workerData
|
|
|
21
21
|
|
|
22
22
|
// Global error handlers to catch critical errors but not test failures
|
|
23
23
|
process.on('uncaughtException', (err) => {
|
|
24
|
+
// Log to stderr to bypass stdout suppression
|
|
25
|
+
process.stderr.write(`[Worker ${workerIndex}] UNCAUGHT EXCEPTION: ${err.message}\n`)
|
|
26
|
+
process.stderr.write(`${err.stack}\n`)
|
|
27
|
+
|
|
24
28
|
// Don't exit on test assertion errors - those are handled by mocha
|
|
25
29
|
if (err.name === 'AssertionError' || err.message?.includes('expected')) {
|
|
26
|
-
console.error(`[Worker ${workerIndex}] Test assertion error (handled by mocha):`, err.message)
|
|
27
30
|
return
|
|
28
31
|
}
|
|
29
|
-
console.error(`[Worker ${workerIndex}] Uncaught exception:`, err.message)
|
|
30
|
-
console.error(err.stack)
|
|
31
32
|
process.exit(1)
|
|
32
33
|
})
|
|
33
34
|
|
|
34
35
|
process.on('unhandledRejection', (reason, promise) => {
|
|
35
|
-
//
|
|
36
|
+
// Log to stderr to bypass stdout suppression
|
|
36
37
|
const msg = reason?.message || String(reason)
|
|
38
|
+
process.stderr.write(`[Worker ${workerIndex}] UNHANDLED REJECTION: ${msg}\n`)
|
|
39
|
+
if (reason?.stack) {
|
|
40
|
+
process.stderr.write(`${reason.stack}\n`)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Don't exit on test-related rejections
|
|
37
44
|
if (msg.includes('expected') || msg.includes('AssertionError')) {
|
|
38
|
-
console.error(`[Worker ${workerIndex}] Test rejection (handled by mocha):`, msg)
|
|
39
45
|
return
|
|
40
46
|
}
|
|
41
|
-
console.error(`[Worker ${workerIndex}] Unhandled rejection:`, reason)
|
|
42
47
|
process.exit(1)
|
|
43
48
|
})
|
|
44
49
|
|
|
@@ -153,8 +158,8 @@ initPromise = (async function () {
|
|
|
153
158
|
await codecept.init(testRoot)
|
|
154
159
|
console.log(`[Worker ${workerIndex}] Codecept initialized successfully`)
|
|
155
160
|
} catch (initErr) {
|
|
156
|
-
|
|
157
|
-
|
|
161
|
+
process.stderr.write(`[Worker ${workerIndex}] FAILED during codecept.init(): ${initErr.message}\n`)
|
|
162
|
+
process.stderr.write(`${initErr.stack}\n`)
|
|
158
163
|
process.exit(1)
|
|
159
164
|
}
|
|
160
165
|
|
|
@@ -186,8 +191,8 @@ initPromise = (async function () {
|
|
|
186
191
|
parentPort?.close()
|
|
187
192
|
}
|
|
188
193
|
} catch (err) {
|
|
189
|
-
|
|
190
|
-
|
|
194
|
+
process.stderr.write(`[Worker ${workerIndex}] FATAL ERROR: ${err.message}\n`)
|
|
195
|
+
process.stderr.write(`${err.stack}\n`)
|
|
191
196
|
process.exit(1)
|
|
192
197
|
}
|
|
193
198
|
})()
|