From ae2d73a1ca23d7e60f92d22e3f6591ae40afb076 Mon Sep 17 00:00:00 2001 From: Steve Herzog Date: Thu, 16 Feb 2023 12:53:18 -0600 Subject: [PATCH 1/7] test_runner: support defining test reporter in NODE_OPTIONS Adds --test-reporter and --test-reporter-destination as allowable options in NODE_OPTIONS. Also adds the CLI flag --test-child-process to allow forcing the default test-reporter for inter-process communication. Fixes: https://github.com/nodejs/node/issues/46484 --- doc/api/cli.md | 8 +++++++ lib/internal/test_runner/runner.js | 3 +++ lib/internal/test_runner/utils.js | 34 ++++++++++++++++++------------ src/node_options.cc | 8 +++++-- src/node_options.h | 1 + 5 files changed, 38 insertions(+), 16 deletions(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index 5ca34109a8b11f..7f245ab5be157e 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -1434,6 +1434,12 @@ added: v19.6.0 The destination for the corresponding test reporter. See the documentation on [test reporters][] for more details. +### `--test-child-process` + +A flag to identify the process as a child of another test process to ensure +that test reporting is formatted correctly to be parsed by a parent test +process. + ### `--test-only`