codeceptjs 4.0.2-beta.11 → 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.
|
@@ -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
|
|
|
@@ -149,7 +154,14 @@ initPromise = (async function () {
|
|
|
149
154
|
codecept = new Codecept(config, optsWithChild)
|
|
150
155
|
|
|
151
156
|
console.log(`[Worker ${workerIndex}] Initializing Codecept...`)
|
|
152
|
-
|
|
157
|
+
try {
|
|
158
|
+
await codecept.init(testRoot)
|
|
159
|
+
console.log(`[Worker ${workerIndex}] Codecept initialized successfully`)
|
|
160
|
+
} catch (initErr) {
|
|
161
|
+
process.stderr.write(`[Worker ${workerIndex}] FAILED during codecept.init(): ${initErr.message}\n`)
|
|
162
|
+
process.stderr.write(`${initErr.stack}\n`)
|
|
163
|
+
process.exit(1)
|
|
164
|
+
}
|
|
153
165
|
|
|
154
166
|
console.log(`[Worker ${workerIndex}] Loading tests...`)
|
|
155
167
|
codecept.loadTests()
|
|
@@ -179,8 +191,8 @@ initPromise = (async function () {
|
|
|
179
191
|
parentPort?.close()
|
|
180
192
|
}
|
|
181
193
|
} catch (err) {
|
|
182
|
-
|
|
183
|
-
|
|
194
|
+
process.stderr.write(`[Worker ${workerIndex}] FATAL ERROR: ${err.message}\n`)
|
|
195
|
+
process.stderr.write(`${err.stack}\n`)
|
|
184
196
|
process.exit(1)
|
|
185
197
|
}
|
|
186
198
|
})()
|