Skip to content

Commit

Permalink
test: remove interval and give more time to unsync
Browse files Browse the repository at this point in the history
  • Loading branch information
pmarchini committed Sep 19, 2024
1 parent 0d4387e commit 9daffe6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/parallel/test-runner-watch-mode-complex.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,17 @@ describe('test runner watch mode with more complex setup', () => {
runs.push(currentRun);
currentRun = '';
const fileToDeletePathLocal = tmpdir.resolve('test-to-delete.mjs');
unlinkSync(fileToDeletePathLocal);
await new Promise((resolve) => setTimeout(() => {
unlinkSync(fileToDeletePathLocal);
resolve();
}, common.platformTimeout(1000)));

const content = fixtureContent['dependency.mjs'];
const path = fixturePaths['dependency.mjs'];
const interval = setInterval(() => writeFileSync(path, content), common.platformTimeout(1000));
setTimeout(() => writeFileSync(path, content), common.platformTimeout(1000));
await ran2.promise;
runs.push(currentRun);
currentRun = '';
clearInterval(interval);
child.kill();

assert.strictEqual(runs.length, 2);
Expand Down

0 comments on commit 9daffe6

Please sign in to comment.