| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 03b19cb commit b8f0ea6
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -531,6 +531,9 @@ function run(options) { | |||
| 531 | 531 | } | |
| 532 | 532 | ||
| 533 | 533 | const root = createTestTree({ __proto__: null, concurrency, timeout, signal }); | |
| 534 | + if (process.env.NODE_TEST_CONTEXT !== undefined) { | ||
| 535 | + return root.reporter; | ||
| 536 | + } | ||
| 534 | 537 | let testFiles = files ?? createTestFileList(); | |
| 535 | 538 | ||
| 536 | 539 | if (shard) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -458,4 +458,37 @@ describe('require(\'node:test\').run', { concurrency: true }, () => { | |||
| 458 | 458 | assert.deepStrictEqual(executedTestFiles.sort(), [...shardsTestsFiles].sort()); | |
| 459 | 459 | }); | |
| 460 | 460 | }); | |
| 461 | + | ||
| 462 | + it('should run with no files', async () => { | ||
| 463 | + const stream = run({ | ||
| 464 | + files: undefined | ||
| 465 | + }).compose(tap); | ||
| 466 | + stream.on('test:fail', common.mustNotCall()); | ||
| 467 | + stream.on('test:pass', common.mustNotCall()); | ||
| 468 | + | ||
| 469 | + // eslint-disable-next-line no-unused-vars | ||
| 470 | + for await (const _ of stream); | ||
| 471 | + }); | ||
| 472 | + | ||
| 473 | + it('should run with no files and use spec reporter', async () => { | ||
| 474 | + const stream = run({ | ||
| 475 | + files: undefined | ||
| 476 | + }).compose(spec); | ||
| 477 | + stream.on('test:fail', common.mustNotCall()); | ||
| 478 | + stream.on('test:pass', common.mustNotCall()); | ||
| 479 | + | ||
| 480 | + // eslint-disable-next-line no-unused-vars | ||
| 481 | + for await (const _ of stream); | ||
| 482 | + }); | ||
| 483 | + | ||
| 484 | + it('should run with no files and use dot reporter', async () => { | ||
| 485 | + const stream = run({ | ||
| 486 | + files: undefined | ||
| 487 | + }).compose(dot); | ||
| 488 | + stream.on('test:fail', common.mustNotCall()); | ||
| 489 | + stream.on('test:pass', common.mustNotCall()); | ||
| 490 | + | ||
| 491 | + // eslint-disable-next-line no-unused-vars | ||
| 492 | + for await (const _ of stream); | ||
| 493 | + }); | ||
| 461 | 494 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments