From e374ba296c28dde2090b5d41639d51633efb179c Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 8 Aug 2023 20:43:42 +0200 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/49014 Reviewed-By: Luigi Pinca Reviewed-By: Benjamin Gruenbaum Reviewed-By: Chemi Atlow --- doc/api/test.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/api/test.md b/doc/api/test.md index 1fcf784c66645c..3131302fb257f8 100644 --- a/doc/api/test.md +++ b/doc/api/test.md @@ -1920,7 +1920,13 @@ clocks or actual timers outside of the mocking environment. ## Class: `TestsStream` * Extends {ReadableStream} @@ -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. @@ -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.