fix: fail-fast in Playwright test runner — exit immediately on first failure

The test() helper was catching errors and collecting them into results[],
only checking for failures after all tests completed. This meant the runner
kept going through remaining tests even after a failure, wasting CI time
and obscuring the root cause.

Now process.exit(1) is called immediately when a test fails, giving true
fail-fast behavior.
This commit is contained in:
you
2026-03-29 17:44:07 +00:00
parent f1d5eca2c0
commit 93cdf31e46
+2
View File
@@ -17,6 +17,8 @@ async function test(name, fn) {
} catch (err) {
results.push({ name, pass: false, error: err.message });
console.log(` \u274c ${name}: ${err.message}`);
console.log(`\nFail-fast: stopping after first failure.`);
process.exit(1);
}
}