mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05:00
test: convert .forEach to for...of in test-net-write-arguments.js
Signed-off-by: EmmanuelFlorencioT <emmanuel.florencio.dev@gmail.com> PR-URL: https://github.com/nodejs/node/pull/67125 Reviewed-By: Ethan Arrowood <ethan@arrowood.dev> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This commit is contained in:
1 parent
d08d94384f
commit
16d1cfd187
1 file changed
+2
-12
@@ -14,17 +14,7 @@ assert.throws(() => {
|
||||
message: 'May not write null values to stream'
|
||||
});
|
||||
|
||||
[
|
||||
true,
|
||||
false,
|
||||
undefined,
|
||||
1,
|
||||
1.0,
|
||||
+Infinity,
|
||||
-Infinity,
|
||||
[],
|
||||
{},
|
||||
].forEach((value) => {
|
||||
for (const value of [ true, false, undefined, 1, 1.0, +Infinity, -Infinity, [], {} ]) {
|
||||
const socket = net.Stream({ highWaterMark: 0 });
|
||||
// We need to check the callback since 'error' will only
|
||||
// be emitted once per instance.
|
||||
@@ -36,4 +26,4 @@ assert.throws(() => {
|
||||
message: 'The "chunk" argument must be of type string or an instance of ' +
|
||||
`Buffer, TypedArray, or DataView.${common.invalidArgTypeHelper(value)}`
|
||||
});
|
||||
});
|
||||
};
|
||||
Reference in new issue
Block a user