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_runner: fix infinite loop when files are undefined in test runner · nodejs/node@d5c9adf

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/test_runner
    • runner.js
  • test/parallel
    • test-runner-run.mjs
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/test_runner/runner.js‎

Copy file name to clipboardExpand all lines: lib/internal/test_runner/runner.js
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,9 @@ function run(options = kEmptyObject) {
487487
}
488488

489489
const root = createTestTree({ __proto__: null, concurrency, timeout, signal });
490+
if (process.env.NODE_TEST_CONTEXT !== undefined) {
491+
return root.reporter;
492+
}
490493
let testFiles = files ?? createTestFileList();
491494

492495
if (shard) {
Collapse file

‎test/parallel/test-runner-run.mjs‎

Copy file name to clipboardExpand all lines: test/parallel/test-runner-run.mjs
+33Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,4 +466,37 @@ describe('require(\'node:test\').run', { concurrency: true }, () => {
466466
}));
467467
});
468468
});
469+
470+
it('should run with no files', async () => {
471+
const stream = run({
472+
files: undefined
473+
}).compose(tap);
474+
stream.on('test:fail', common.mustNotCall());
475+
stream.on('test:pass', common.mustNotCall());
476+
477+
// eslint-disable-next-line no-unused-vars
478+
for await (const _ of stream);
479+
});
480+
481+
it('should run with no files and use spec reporter', async () => {
482+
const stream = run({
483+
files: undefined
484+
}).compose(spec);
485+
stream.on('test:fail', common.mustNotCall());
486+
stream.on('test:pass', common.mustNotCall());
487+
488+
// eslint-disable-next-line no-unused-vars
489+
for await (const _ of stream);
490+
});
491+
492+
it('should run with no files and use dot reporter', async () => {
493+
const stream = run({
494+
files: undefined
495+
}).compose(dot);
496+
stream.on('test:fail', common.mustNotCall());
497+
stream.on('test:pass', common.mustNotCall());
498+
499+
// eslint-disable-next-line no-unused-vars
500+
for await (const _ of stream);
501+
});
469502
});

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.