diff options
author | Daeyeon Jeong <daeyeon.dev@gmail.com> | 2023-05-17 15:24:07 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-17 06:24:07 +0000 |
commit | 5cb5422b6ff29018c915a497da0ce1a509e1d52c (patch) | |
tree | 41a6f016aba88cd06f8963df716c409915d890da | |
parent | ca096563e02acf79e572ea9eb7ba81722b1cb399 (diff) | |
download | node-new-5cb5422b6ff29018c915a497da0ce1a509e1d52c.tar.gz |
test: fix parsing test flags
This removes replacing `_` with `-` in the flags defined.
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/48012
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
-rw-r--r-- | test/common/index.js | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/test/common/index.js b/test/common/index.js index f3caa9d1d4..6bea72487f 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -82,7 +82,6 @@ function parseTestFlags(filename = process.argv[1]) { } return source .substring(flagStart, flagEnd) - .replace(/_/g, '-') .split(/\s+/) .filter(Boolean); } @@ -98,9 +97,8 @@ if (process.argv.length === 2 && require('cluster').isPrimary && fs.existsSync(process.argv[1])) { const flags = parseTestFlags(); - const args = process.execArgv.map((arg) => arg.replace(/_/g, '-')); for (const flag of flags) { - if (!args.includes(flag) && + if (!process.execArgv.includes(flag) && // If the binary is build without `intl` the inspect option is // invalid. The test itself should handle this case. (process.features.inspector || !flag.startsWith('--inspect'))) { |