From 1ca598c5ce1bed67aa36b857d5eae2dd685d26e1 Mon Sep 17 00:00:00 2001 From: Aviv Keller <38299977+RedYetiDev@users.noreply.github.com> Date: Fri, 16 Aug 2024 08:58:39 -0400 Subject: [PATCH] cli: allow `--test-[name/skip]-pattern` in `NODE_OPTIONS` PR-URL: https://github.com/nodejs/node/pull/53001 Reviewed-By: Colin Ihrig Reviewed-By: Moshe Atlow --- doc/api/cli.md | 2 ++ src/node_options.cc | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index 7133a7a369bdfd..187ac88338faea 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -3021,10 +3021,12 @@ one is included in the list below. * `--snapshot-blob` * `--test-coverage-exclude` * `--test-coverage-include` +* `--test-name-pattern` * `--test-only` * `--test-reporter-destination` * `--test-reporter` * `--test-shard` +* `--test-skip-pattern` * `--throw-deprecation` * `--title` * `--tls-cipher-list` diff --git a/src/node_options.cc b/src/node_options.cc index 068f85720f2957..441ffe284405a4 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -670,7 +670,8 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() { &EnvironmentOptions::test_runner_snapshots); AddOption("--test-name-pattern", "run tests whose name matches this regular expression", - &EnvironmentOptions::test_name_pattern); + &EnvironmentOptions::test_name_pattern, + kAllowedInEnvvar); AddOption("--test-reporter", "report test output using the given reporter", &EnvironmentOptions::test_reporter, @@ -689,7 +690,8 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() { kAllowedInEnvvar); AddOption("--test-skip-pattern", "run tests whose name do not match this regular expression", - &EnvironmentOptions::test_skip_pattern); + &EnvironmentOptions::test_skip_pattern, + kAllowedInEnvvar); AddOption("--test-coverage-include", "include files in coverage report that match this glob pattern", &EnvironmentOptions::coverage_include_pattern,