From b73c9f6e060bf1c9384cb391123bea7384a1493c Mon Sep 17 00:00:00 2001 From: RedYetiDev <38299977+RedYetiDev@users.noreply.github.com> Date: Tue, 13 Aug 2024 14:58:55 -0400 Subject: [PATCH] cli: allow `--test-[name/skip]-pattern` in `NODE_OPTIONS` --- 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 c90f3763f3d523..7decfd1dfd0237 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -2993,10 +2993,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 67eb0b890aa144..6c1ee44d9583bb 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -658,7 +658,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, @@ -677,7 +678,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,