GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: force spec reporter in test-runner-watch-mode.mjs · nodejs/node@b5eb24c

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-runner-watch-mode.mjs
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-runner-watch-mode.mjs‎

Copy file name to clipboardExpand all lines: test/parallel/test-runner-watch-mode.mjs
+11-10Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ async function testWatch({ fileToUpdate, file, action = 'update' }) {
4141
const ran1 = util.createDeferredPromise();
4242
const ran2 = util.createDeferredPromise();
4343
const child = spawn(process.execPath,
44-
['--watch', '--test', file ? fixturePaths[file] : undefined].filter(Boolean),
44+
['--watch', '--test', '--test-reporter=spec',
45+
file ? fixturePaths[file] : undefined].filter(Boolean),
4546
{ encoding: 'utf8', stdio: 'pipe', cwd: tmpdir.path });
4647
let stdout = '';
4748
let currentRun = '';
@@ -50,7 +51,7 @@ async function testWatch({ fileToUpdate, file, action = 'update' }) {
5051
child.stdout.on('data', (data) => {
5152
stdout += data.toString();
5253
currentRun += data.toString();
53-
const testRuns = stdout.match(/# duration_ms\s\d+/g);
54+
const testRuns = stdout.match(/duration_ms\s\d+/g);
5455
if (testRuns?.length >= 1) ran1.resolve();
5556
if (testRuns?.length >= 2) ran2.resolve();
5657
});
@@ -71,10 +72,10 @@ async function testWatch({ fileToUpdate, file, action = 'update' }) {
7172
assert.strictEqual(runs.length, 2);
7273

7374
for (const run of runs) {
74-
assert.match(run, /# tests 1/);
75-
assert.match(run, /# pass 1/);
76-
assert.match(run, /# fail 0/);
77-
assert.match(run, /# cancelled 0/);
75+
assert.match(run, /tests 1/);
76+
assert.match(run, /pass 1/);
77+
assert.match(run, /fail 0/);
78+
assert.match(run, /cancelled 0/);
7879
}
7980
};
8081

@@ -94,10 +95,10 @@ async function testWatch({ fileToUpdate, file, action = 'update' }) {
9495
assert.strictEqual(runs.length, 2);
9596

9697
for (const run of runs) {
97-
assert.match(run, /# tests 1/);
98-
assert.match(run, /# pass 1/);
99-
assert.match(run, /# fail 0/);
100-
assert.match(run, /# cancelled 0/);
98+
assert.match(run, /tests 1/);
99+
assert.match(run, /pass 1/);
100+
assert.match(run, /fail 0/);
101+
assert.match(run, /cancelled 0/);
101102
}
102103
};
103104

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.