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:
Emmanuel Florencio Trujillo authored and Antoine du Hamel committed 2026-11-12 17:45:32 +01:00
1 parent d08d94384f
commit 16d1cfd187
1 file changed
+2 -12
+2 -12
View File
@@ -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)}`
});
});
};