Skip to content

Commit

Permalink
test: replace forEach with for..of in test-parse-args.mjs
Browse files Browse the repository at this point in the history
PR-URL: nodejs#49824
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
  • Loading branch information
niyashiyas authored Oct 9, 2023
1 parent 387e292 commit 76004f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/parallel/test-parse-args.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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' } };
Expand All @@ -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'];
Expand Down

0 comments on commit 76004f3

Please sign in to comment.