From 5d183fc3c58ef1fbb77e026fdfd40c5ab125af20 Mon Sep 17 00:00:00 2001 From: sangwook Date: Sat, 7 Nov 2026 19:33:06 +0900 Subject: [PATCH 1/3] test_runner: add tags and workerId to SuiteContext TestContext exposes tags and workerId, but SuiteContext does not, so a describe() callback cannot read the suite's tags, including the ones inherited from ancestor suites. Expose both on SuiteContext as well. Signed-off-by: sangwook --- doc/api/test.md | 26 +++++++++++++++++++ lib/internal/test_runner/test.js | 9 +++++++ .../fixtures/test-runner/worker-id/test-1.mjs | 8 +++++- .../parallel/test-runner-tags-inheritance.mjs | 8 ++++++ 4 files changed, 50 insertions(+), 1 deletion(-) diff --git a/doc/api/test.md b/doc/api/test.md index b80bdb372dc2..32b0c748fdd1 100644 --- a/doc/api/test.md +++ b/doc/api/test.md @@ -5141,6 +5141,32 @@ The attempt number of the suite. This value is zero-based, so the first attempt the second attempt is `1`, and so on. This property is useful in conjunction with the `--test-rerun-failures` option to determine the attempt number of the current run. +### `context.tags` + + + +> Stability: 1.0 - Early development + +* Type: {string\[]} + +A frozen array of the suite's flattened lowercased tags, in declaration +order, including any tags inherited from ancestor suites. Empty when the +suite has no tags. See [Test tags][]. + +### `context.workerId` + + + +* Type: {number|undefined} + +The unique identifier of the worker running the current test file. This value +is derived from the `NODE_TEST_WORKER_ID` environment variable, and is +`undefined` when not running in a test context. + ### `context.diagnostic(message)`