| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2581fce commit d5c9adf
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -487,6 +487,9 @@ function run(options = kEmptyObject) { | |||
| 487 | 487 | } | |
| 488 | 488 | ||
| 489 | 489 | const root = createTestTree({ __proto__: null, concurrency, timeout, signal }); | |
| 490 | + if (process.env.NODE_TEST_CONTEXT !== undefined) { | ||
| 491 | + return root.reporter; | ||
| 492 | + } | ||
| 490 | 493 | let testFiles = files ?? createTestFileList(); | |
| 491 | 494 | ||
| 492 | 495 | if (shard) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -466,4 +466,37 @@ describe('require(\'node:test\').run', { concurrency: true }, () => { | |||
| 466 | 466 | })); | |
| 467 | 467 | }); | |
| 468 | 468 | }); | |
| 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 | + }); | ||
| 469 | 502 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments