diff --git a/test/parallel/test-runner-run-watch.mjs b/test/parallel/test-runner-run-watch.mjs index 9ad9eaf1b60e4b..8ccc4646de2a26 100644 --- a/test/parallel/test-runner-run-watch.mjs +++ b/test/parallel/test-runner-run-watch.mjs @@ -59,8 +59,8 @@ async function testWatch( if (runnerCwd) args.push('--cwd', runnerCwd); if (isolation) args.push('--isolation', isolation); const child = spawn(process.execPath, - args, - { encoding: 'utf8', stdio: 'pipe', cwd }); + args, + { encoding: 'utf8', stdio: 'pipe', cwd }); let stdout = ''; let currentRun = ''; const runs = []; @@ -104,9 +104,9 @@ async function testWatch( const fileToRenamePath = tmpdir.resolve(fileToUpdate); const newFileNamePath = tmpdir.resolve(`test-renamed-${fileToUpdate}`); const interval = setInterval(() => { - renameSync(fileToRenamePath, newFileNamePath), common.platformTimeout(1000) + renameSync(fileToRenamePath, newFileNamePath); clearInterval(interval); - }); + }, common.platformTimeout(1000)); await ran2.promise; runs.push(currentRun); child.kill(); diff --git a/test/parallel/test-runner-watch-mode.mjs b/test/parallel/test-runner-watch-mode.mjs index e1980fe815cf3f..885936ed9c5238 100644 --- a/test/parallel/test-runner-watch-mode.mjs +++ b/test/parallel/test-runner-watch-mode.mjs @@ -91,7 +91,7 @@ async function testWatch({ const fileToRenamePath = tmpdir.resolve(fileToUpdate); const newFileNamePath = tmpdir.resolve(`test-renamed-${fileToUpdate}`); const interval = setInterval(() => { - renameSync(fileToRenamePath, newFileNamePath) + renameSync(fileToRenamePath, newFileNamePath); clearInterval(interval); }, common.platformTimeout(1000)); await ran2.promise;