From 15803a08009c4b6b943e79b41226973c235e4450 Mon Sep 17 00:00:00 2001 From: Steve Herzog Date: Thu, 16 Feb 2023 12:53:18 -0600 Subject: [PATCH] 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 | 5 +++++ lib/internal/test_runner/utils.js | 34 ++++++++++++++++++------------ src/node_options.cc | 8 +++++-- src/node_options.h | 1 + 5 files changed, 40 insertions(+), 16 deletions(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index 2c5a1969861c2e..5bcfaae3659d85 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -1272,6 +1272,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`