test: replace forEach with for..of in test-parse-args.mjs
PR-URL: https://github.com/nodejs/node/pull/49824 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
This commit is contained in:
parent
387e2929fe
commit
76004f3e56
@ -451,7 +451,7 @@ const candidateGreedyOptions = [
|
||||
'--foo',
|
||||
];
|
||||
|
||||
candidateGreedyOptions.forEach((value) => {
|
||||
for (const value of candidateGreedyOptions) {
|
||||
test(`greedy: when short option with value '${value}' then eaten`, () => {
|
||||
const args = ['-w', value];
|
||||
const options = { with: { type: 'string', short: 'w' } };
|
||||
@ -469,7 +469,7 @@ candidateGreedyOptions.forEach((value) => {
|
||||
const result = parseArgs({ args, options, strict: false });
|
||||
assert.deepStrictEqual(result, expectedResult);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
test('strict: when candidate option value is plain text then does not throw', () => {
|
||||
const args = ['--with', 'abc'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user