Skip to content

Commit 4e877c0

Browse files
authored
test(fixture): prevent start failure teardowns whole process (#55760)
### What? In some test failures we've been observing test result is not written at all like ``` Failed to load test output [Error: ENOENT: no such file or directory, open 'test/e2e/app-dir/edge-runtime-node-compatibility/edge-runtime-node-compatibility.test.ts.results.json'] { errno: -2, code: 'ENOENT', syscall: 'open', path: 'test/e2e/app-dir/edge-runtime-node-compatibility/edge-runtime-node-compatibility.test.ts.results.json' } ``` scrolling up, it was due to whole test process was taken down by calling process.exit explicitly. We want to collect test results for the failures still, so the PR amends it for the cases if it's specified to continue on error. Closes WEB-1628
1 parent 67294fc commit 4e877c0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/lib/e2e-utils.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,12 @@ export async function createNext(
196196
try {
197197
nextInstance.destroy()
198198
} catch (_) {}
199-
process.exit(1)
199+
200+
if (process.env.NEXT_TEST_CONTINUE_ON_ERROR) {
201+
throw err
202+
} else {
203+
process.exit(1)
204+
}
200205
} finally {
201206
flushAllTraces()
202207
}

0 commit comments

Comments
 (0)