Sitelet https://github.com/nodejs/node/pull/46577/commits/fb486d21023a53d75ddf37baf6c0fdc1335bfdea
Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
remove logs
  • Loading branch information
MoLow committed Feb 26, 2023
commit fb486d21023a53d75ddf37baf6c0fdc1335bfdea
4 changes: 0 additions & 4 deletions test/parallel/test-runner-watch-mode.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,17 @@ async function testWatch({ files, fileToUpdate }) {
const child = spawn(process.execPath, ['--watch', '--test', '--no-warnings', ...files], { encoding: 'utf8' });
let stdout = '';

console.log(`${child.pid} [running test]`);
child.stdout.on('data', (data) => {
console.log(data.toString().split(/\r?\n/).map((line) => `${child.pid} [stdout] ${line}`).join('\n'));
stdout += data.toString();
const matches = stdout.match(/test has ran/g);
if (matches?.length >= 1) ran1.resolve();
if (matches?.length >= 2) ran2.resolve();
});

await ran1.promise;
console.log(`${child.pid} [restarting]`);
const interval = setInterval(() => writeFileSync(fileToUpdate, readFileSync(fileToUpdate, 'utf8')), 50);
await ran2.promise;
clearInterval(interval);
console.log(`${child.pid} [done]`);
child.kill();
}

Expand Down