Skip to content

Commit

Permalink
test: replace forEach with for [...] of
Browse files Browse the repository at this point in the history
PR-URL: #50615
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
  • Loading branch information
dygabo authored and UlisesGascon committed Dec 11, 2023
1 parent b48cf31 commit ea61261
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/parallel/test-fs-timestamp-parsing-error.js
Expand Up @@ -3,7 +3,7 @@ require('../common');
const assert = require('assert');
const fs = require('fs');

[Infinity, -Infinity, NaN].forEach((input) => {
for (const input of [Infinity, -Infinity, NaN]) {
assert.throws(
() => {
fs._toUnixTimestamp(input);
Expand All @@ -12,7 +12,7 @@ const fs = require('fs');
code: 'ERR_INVALID_ARG_TYPE',
name: 'TypeError'
});
});
}

assert.throws(
() => {
Expand All @@ -24,6 +24,6 @@ assert.throws(
});

const okInputs = [1, -1, '1', '-1', Date.now()];
okInputs.forEach((input) => {
for (const input of okInputs) {
fs._toUnixTimestamp(input);
});
}

0 comments on commit ea61261

Please sign in to comment.