Skip to content

Commit 36227ed

Browse files
MoLowdanielleadams
authored andcommitted
test: fix watch mode test flake
PR-URL: #44739 Backport-PR-URL: #44815 Fixes: #44735 Reviewed-By: Erick Wendel <erick.workspace@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
1 parent 3abd71a commit 36227ed

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/sequential/test-watch-mode.mjs

+3-1
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,10 @@ describe('watch mode', { concurrency: true, timeout: 60_0000 }, () => {
9494
const file = fixtures.path('watch-mode/failing.js');
9595
const { stderr, stdout } = await spawnWithRestarts({ file });
9696

97+
// Use match first to pretty print diff on failure
9798
assert.match(stderr, /Error: fails\r?\n/);
98-
assert.strictEqual(stderr.match(/Error: fails\r?\n/g).length, 2);
99+
// Test that failures happen once per restart
100+
assert(stderr.match(/Error: fails\r?\n/g).length >= 2);
99101
assertRestartedCorrectly({
100102
stdout,
101103
messages: { completed: `Failed running ${inspect(file)}`, restarted: `Restarting ${inspect(file)}` },

0 commit comments

Comments
 (0)