Skip to content

Commit e374ba2

Browse files
philnashtargos
authored andcommitted
doc: add "type" to test runner event details
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 <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Chemi Atlow <[email protected]>
1 parent ec0a6c1 commit e374ba2

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

‎doc/api/test.md‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1920,7 +1920,13 @@ clocks or actual timers outside of the mocking environment.
19201920
## Class: `TestsStream`
19211921

19221922
<!-- YAML
1923-
added: v18.9.0
1923+
added:
1924+
- v18.9.0
1925+
- v16.19.0
1926+
changes:
1927+
- version: v18.17.0
1928+
pr-url: https://github.com/nodejs/node/pull/47094
1929+
description: added type to test:pass and test:fail events for when the test is a suite.
19241930
-->
19251931

19261932
* Extends{ReadableStream}
@@ -2002,6 +2008,8 @@ Emitted when a test is enqueued for execution.
20022008
*`duration_ms`{number} The duration of the test in milliseconds.
20032009
*`error`{Error} An error wrapping the error thrown by the test.
20042010
*`cause`{Error} The actual error thrown by the test.
2011+
*`type`{string|undefined} The type of the test, used to denote whether
2012+
this is a suite.
20052013
*`file`{string|undefined} The path of the test file,
20062014
`undefined` if test was run through the REPL.
20072015
*`name`{string} The test name.
@@ -2017,6 +2025,8 @@ Emitted when a test fails.
20172025
*`data`{Object}
20182026
*`details`{Object} Additional execution metadata.
20192027
*`duration_ms`{number} The duration of the test in milliseconds.
2028+
*`type`{string|undefined} The type of the test, used to denote whether
2029+
this is a suite.
20202030
*`file`{string|undefined} The path of the test file,
20212031
`undefined` if test was run through the REPL.
20222032
*`name`{string} The test name.

0 commit comments

Comments
(0)