Skip to content
Merged
Show file tree
Hide file tree
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
Next Next commit
test: remove reporter specific assertions
  • Loading branch information
pmarchini committed Aug 26, 2024
commit 406117618c352a39379c41e9ea042ec2f39f137e
34 changes: 17 additions & 17 deletions test/parallel/test-runner-run-watch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ async function testWatch({ fileToUpdate, file, action = 'update', cwd = tmpdir.p
child.stdout.on('data', (data) => {
stdout += data.toString();
currentRun += data.toString();
const testRuns = stdout.match(/# duration_ms\s\d+/g);
const testRuns = stdout.match(/ duration_ms\s\d+/g);
if (testRuns?.length >= 1) ran1.resolve();
if (testRuns?.length >= 2) ran2.resolve();
});
Expand All @@ -78,10 +78,10 @@ async function testWatch({ fileToUpdate, file, action = 'update', cwd = tmpdir.p

for (const run of runs) {
assert.doesNotMatch(run, /run\(\) is being called recursively/);
assert.match(run, /# tests 1/);
assert.match(run, /# pass 1/);
assert.match(run, /# fail 0/);
assert.match(run, /# cancelled 0/);
assert.match(run, / tests 1/);
assert.match(run, / pass 1/);
assert.match(run, / fail 0/);
assert.match(run, / cancelled 0/);
}
};

Expand All @@ -101,21 +101,21 @@ async function testWatch({ fileToUpdate, file, action = 'update', cwd = tmpdir.p
assert.strictEqual(runs.length, 2);

const [firstRun, secondRun] = runs;
assert.match(firstRun, /# tests 1/);
assert.match(firstRun, /# pass 1/);
assert.match(firstRun, /# fail 0/);
assert.match(firstRun, /# cancelled 0/);
assert.match(firstRun, / tests 1/);
assert.match(firstRun, / pass 1/);
assert.match(firstRun, / fail 0/);
assert.match(firstRun, / cancelled 0/);
assert.doesNotMatch(firstRun, /run\(\) is being called recursively/);

if (action === 'rename2') {
assert.match(secondRun, /MODULE_NOT_FOUND/);
return;
}

assert.match(secondRun, /# tests 1/);
assert.match(secondRun, /# pass 1/);
assert.match(secondRun, /# fail 0/);
assert.match(secondRun, /# cancelled 0/);
assert.match(secondRun, / tests 1/);
assert.match(secondRun, / pass 1/);
assert.match(secondRun, / fail 0/);
assert.match(secondRun, / cancelled 0/);
assert.doesNotMatch(secondRun, /run\(\) is being called recursively/);
};

Expand Down Expand Up @@ -163,10 +163,10 @@ async function testWatch({ fileToUpdate, file, action = 'update', cwd = tmpdir.p
await once(child, 'exit');

for (const run of runs) {
assert.match(run, /# tests 1/);
assert.match(run, /# pass 1/);
assert.match(run, /# fail 0/);
assert.match(run, /# cancelled 0/);
assert.match(run, / tests 1/);
assert.match(run, / pass 1/);
assert.match(run, / fail 0/);
assert.match(run, / cancelled 0/);
}
};

Expand Down
8 changes: 4 additions & 4 deletions test/parallel/test-runner-watch-mode.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ async function testWatch({
await once(child, 'exit');

for (const run of runs) {
assert.match(run, /# tests 1/);
assert.match(run, /# pass 1/);
assert.match(run, /# fail 0/);
assert.match(run, /# cancelled 0/);
assert.match(run, / tests 1/);
assert.match(run, / pass 1/);
assert.match(run, / fail 0/);
assert.match(run, / cancelled 0/);
}
};

Expand Down