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:
Niya Shiyas 2023-10-09 18:53:15 +05:30 committed by GitHub
parent 387e2929fe
commit 76004f3e56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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'];