Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: fix parsing test flags
This removes replacing `_` with `-` in the flags defined.

Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
  • Loading branch information
daeyeon committed May 15, 2023
commit 0c2e3a2667cd0a36ffb6804e0fcd656b93a42dde
4 changes: 1 addition & 3 deletions test/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ function parseTestFlags(filename = process.argv[1]) {
}
return source
.substring(flagStart, flagEnd)
.replace(/_/g, '-')
.split(/\s+/)
.filter(Boolean);
}
Expand All @@ -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'))) {
Expand Down