From 0c2e3a2667cd0a36ffb6804e0fcd656b93a42dde Mon Sep 17 00:00:00 2001 From: Daeyeon Jeong Date: Mon, 15 May 2023 14:39:51 +0900 Subject: [PATCH] test: fix parsing test flags This removes replacing `_` with `-` in the flags defined. Signed-off-by: Daeyeon Jeong --- test/common/index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/common/index.js b/test/common/index.js index f3caa9d1d4bdce..6bea72487f3676 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'))) {