diff --git a/test/parallel/test-fs-readv-sync.js b/test/parallel/test-fs-readv-sync.js index 22f28c7830e746..548f54cbb9e3b2 100644 --- a/test/parallel/test-fs-readv-sync.js +++ b/test/parallel/test-fs-readv-sync.js @@ -66,21 +66,21 @@ const wrongInputs = [false, 'test', {}, [{}], ['sdf'], null, undefined]; { const fd = fs.openSync(filename, 'r'); - wrongInputs.forEach((wrongInput) => { + for (const wrongInput of wrongInputs) { assert.throws( () => fs.readvSync(fd, wrongInput, null), { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError' } ); - }); + } fs.closeSync(fd); } { // fs.readv with wrong fd argument - wrongInputs.forEach((wrongInput) => { + for (const wrongInput of wrongInputs) { assert.throws( () => fs.readvSync(wrongInput), { @@ -88,5 +88,5 @@ const wrongInputs = [false, 'test', {}, [{}], ['sdf'], null, undefined]; name: 'TypeError' } ); - }); + } } diff --git a/test/parallel/test-fs-readv.js b/test/parallel/test-fs-readv.js index aa24c3e06ba4de..111719a7efbb0f 100644 --- a/test/parallel/test-fs-readv.js +++ b/test/parallel/test-fs-readv.js @@ -67,22 +67,21 @@ const wrongInputs = [false, 'test', {}, [{}], ['sdf'], null, undefined]; fs.writeFileSync(filename, exptectedBuff); const fd = fs.openSync(filename, 'r'); - - wrongInputs.forEach((wrongInput) => { + for (const wrongInput of wrongInputs) { assert.throws( () => fs.readv(fd, wrongInput, null, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError' } ); - }); + } fs.closeSync(fd); } { // fs.readv with wrong fd argument - wrongInputs.forEach((wrongInput) => { + for (const wrongInput of wrongInputs) { assert.throws( () => fs.readv(wrongInput, common.mustNotCall()), { @@ -90,5 +89,5 @@ const wrongInputs = [false, 'test', {}, [{}], ['sdf'], null, undefined]; name: 'TypeError' } ); - }); + } }