| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d4dfb66 commit b5b84c9
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3454,6 +3454,45 @@ object, streaming a series of events representing the execution of the tests. | |||
| 3454 | 3454 | Some of the events are guaranteed to be emitted in the same order as the tests | |
| 3455 | 3455 | are defined, while others are emitted in the order that the tests execute. | |
| 3456 | 3456 | ||
| 3457 | + The following tables summarize all events by scope. | ||
| 3458 | + | ||
| 3459 | + Test scoped events are emitted once per test or suite. Most of them come in | ||
| 3460 | + pairs: a declaration ordered event, buffered so that events are emitted in the | ||
| 3461 | + same order as the tests are defined, and one or more corresponding execution | ||
| 3462 | + ordered events, emitted immediately as the tests execute. | ||
| 3463 | + | ||
| 3464 | + | Declaration ordered (buffered) | Execution ordered (immediate) | | ||
| 3465 | + | ------------------------------ | ----------------------------------------------------- | | ||
| 3466 | + | [`'test:start'`][] | [`'test:enqueue'`][] followed by [`'test:dequeue'`][] | | ||
| 3467 | + | [`'test:pass'`][] | [`'test:complete'`][] (`details.passed` is `true`) | | ||
| 3468 | + | [`'test:fail'`][] | [`'test:complete'`][] (`details.passed` is `false`) | | ||
| 3469 | + | [`'test:plan'`][] | | | ||
| 3470 | + | [`'test:diagnostic'`][] | | | ||
| 3471 | + | ||
| 3472 | + File scoped and global events are always emitted immediately, in execution | ||
| 3473 | + order. | ||
| 3474 | + | ||
| 3475 | + File scoped events are emitted once per test file: | ||
| 3476 | + | ||
| 3477 | + | Event | Notes | | ||
| 3478 | + | -------------------- | ---------------------------------------------- | | ||
| 3479 | + | [`'test:stderr'`][] | Only emitted if the `--test` flag is passed. | | ||
| 3480 | + | [`'test:stdout'`][] | Only emitted if the `--test` flag is passed. | | ||
| 3481 | + | [`'test:summary'`][] | Per file, only when process isolation is used. | | ||
| 3482 | + | ||
| 3483 | + Global events are emitted once per test run: | ||
| 3484 | + | ||
| 3485 | + | Event | Notes | | ||
| 3486 | + | ---------------------------- | ------------------------------------ | | ||
| 3487 | + | [`'test:summary'`][] | The final cumulative summary. | | ||
| 3488 | + | [`'test:coverage'`][] | Only when code coverage is enabled. | | ||
| 3489 | + | [`'test:interrupted'`][] | Only when the run receives `SIGINT`. | | ||
| 3490 | + | [`'test:watch:drained'`][] | Watch mode only. | | ||
| 3491 | + | [`'test:watch:restarted'`][] | Watch mode only. | | ||
| 3492 | + | ||
| 3493 | + The root test also emits [`'test:plan'`][] and [`'test:diagnostic'`][] events | ||
| 3494 | + at the end of the run to report run level totals. | ||
| 3495 | + | ||
| 3457 | 3496 | ### Event: `'test:coverage'` | |
| 3458 | 3497 | ||
| 3459 | 3498 | * `data` {Object} | |
@@ -4702,6 +4741,21 @@ test.describe('my suite', (suite) => { | |||
| 4702 | 4741 | ||
| 4703 | 4742 | [TAP]: https://testanything.org/ | |
| 4704 | 4743 | [Test tags]: #test-tags | |
| 4744 | + [`'test:complete'`]: #event-testcomplete | ||
| 4745 | + [`'test:coverage'`]: #event-testcoverage | ||
| 4746 | + [`'test:dequeue'`]: #event-testdequeue | ||
| 4747 | + [`'test:diagnostic'`]: #event-testdiagnostic | ||
| 4748 | + [`'test:enqueue'`]: #event-testenqueue | ||
| 4749 | + [`'test:fail'`]: #event-testfail | ||
| 4750 | + [`'test:interrupted'`]: #event-testinterrupted | ||
| 4751 | + [`'test:pass'`]: #event-testpass | ||
| 4752 | + [`'test:plan'`]: #event-testplan | ||
| 4753 | + [`'test:start'`]: #event-teststart | ||
| 4754 | + [`'test:stderr'`]: #event-teststderr | ||
| 4755 | + [`'test:stdout'`]: #event-teststdout | ||
| 4756 | + [`'test:summary'`]: #event-testsummary | ||
| 4757 | + [`'test:watch:drained'`]: #event-testwatchdrained | ||
| 4758 | + [`'test:watch:restarted'`]: #event-testwatchrestarted | ||
| 4705 | 4759 | [`--experimental-test-coverage`]: cli.md#--experimental-test-coverage | |
| 4706 | 4760 | [`--experimental-test-module-mocks`]: cli.md#--experimental-test-module-mocks | |
| 4707 | 4761 | [`--experimental-test-tag-filter`]: cli.md#--experimental-test-tag-filtertag | |
| Back | FazBrowse Home | New Git URL |
0 commit comments