Skip to content
Permalink
Browse files
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>
  • Loading branch information
MoLow authored and danielleadams committed Oct 2, 2022
1 parent 3abd71a commit 36227ed8621744ab837ab1a760c03150713aa4c1
Showing 1 changed file with 3 additions and 1 deletion.
@@ -94,8 +94,10 @@ describe('watch mode', { concurrency: true, timeout: 60_0000 }, () => {
const file = fixtures.path('watch-mode/failing.js');
const { stderr, stdout } = await spawnWithRestarts({ file });

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

0 comments on commit 36227ed

Please sign in to comment.