Skip to content

Commit a259b95

Browse files
committed
test: replace forEach with for..of in test-fs-readv.js
1 parent e329a11 commit a259b95

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

test/parallel/test-fs-readv-sync.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -66,27 +66,27 @@ const wrongInputs = [false, 'test', {}, [{}], ['sdf'], null, undefined];
6666
{
6767
const fd = fs.openSync(filename, 'r');
6868

69-
wrongInputs.forEach((wrongInput) => {
69+
for(const wrongInput of wrongInputs) {
7070
assert.throws(
7171
() => fs.readvSync(fd, wrongInput, null), {
7272
code: 'ERR_INVALID_ARG_TYPE',
7373
name: 'TypeError'
7474
}
7575
);
76-
});
76+
};
7777

7878
fs.closeSync(fd);
7979
}
8080

8181
{
8282
// fs.readv with wrong fd argument
83-
wrongInputs.forEach((wrongInput) => {
83+
for(const wrongInput of wrongInputs) {
8484
assert.throws(
8585
() => fs.readvSync(wrongInput),
8686
{
8787
code: 'ERR_INVALID_ARG_TYPE',
8888
name: 'TypeError'
8989
}
9090
);
91-
});
91+
};
9292
}

test/parallel/test-fs-readv.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -68,27 +68,27 @@ const wrongInputs = [false, 'test', {}, [{}], ['sdf'], null, undefined];
6868
const fd = fs.openSync(filename, 'r');
6969

7070

71-
wrongInputs.forEach((wrongInput) => {
71+
for(const wrongInput of wrongInputs) {
7272
assert.throws(
7373
() => fs.readv(fd, wrongInput, null, common.mustNotCall()), {
7474
code: 'ERR_INVALID_ARG_TYPE',
7575
name: 'TypeError'
7676
}
7777
);
78-
});
78+
};
7979

8080
fs.closeSync(fd);
8181
}
8282

8383
{
8484
// fs.readv with wrong fd argument
85-
wrongInputs.forEach((wrongInput) => {
85+
for(const wrongInput of wrongInputs) {
8686
assert.throws(
8787
() => fs.readv(wrongInput, common.mustNotCall()),
8888
{
8989
code: 'ERR_INVALID_ARG_TYPE',
9090
name: 'TypeError'
9191
}
9292
);
93-
});
93+
};
9494
}

0 commit comments

Comments
 (0)