Skip to content

Commit

Permalink
doc: add "type" to test runner event details
Browse files Browse the repository at this point in the history
In version 20.0.0 (and backported to 19.9.0 and 18.7.0) the test runner
started reporting on whether a test was a suite. This was exposed to
reporters in the `details` object of a `test:pass` or `test:fail` event
but this hasn't been documented. This adds the `type` property to both
event's `details` object.

PR-URL: #49014
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
  • Loading branch information
philnash authored and targos committed Oct 28, 2023
1 parent ec0a6c1 commit e374ba2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion doc/api/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -1920,7 +1920,13 @@ clocks or actual timers outside of the mocking environment.
## Class: `TestsStream`

<!-- YAML
added: v18.9.0
added:
- v18.9.0
- v16.19.0
changes:
- version: v18.17.0
pr-url: https://github.com/nodejs/node/pull/47094
description: added type to test:pass and test:fail events for when the test is a suite.
-->

* Extends {ReadableStream}
Expand Down Expand Up @@ -2002,6 +2008,8 @@ Emitted when a test is enqueued for execution.
* `duration_ms` {number} The duration of the test in milliseconds.
* `error` {Error} An error wrapping the error thrown by the test.
* `cause` {Error} The actual error thrown by the test.
* `type` {string|undefined} The type of the test, used to denote whether
this is a suite.
* `file` {string|undefined} The path of the test file,
`undefined` if test was run through the REPL.
* `name` {string} The test name.
Expand All @@ -2017,6 +2025,8 @@ Emitted when a test fails.
* `data` {Object}
* `details` {Object} Additional execution metadata.
* `duration_ms` {number} The duration of the test in milliseconds.
* `type` {string|undefined} The type of the test, used to denote whether
this is a suite.
* `file` {string|undefined} The path of the test file,
`undefined` if test was run through the REPL.
* `name` {string} The test name.
Expand Down

0 comments on commit e374ba2

Please sign in to comment.