Skip to content

Commit

Permalink
test: replace forEach() with for...of in test/parallel/test-util-log.js
Browse files Browse the repository at this point in the history
PR-URL: #50783
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
edodusi authored and richardlau committed Mar 25, 2024
1 parent d8da197 commit 55c423b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/parallel/test-util-log.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ const tests = [

// test util.log()
const re = /[0-9]{1,2} [A-Z][a-z]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} - (.+)$/;
tests.forEach(function(test) {
for (const test of tests) {
util.log(test.input);
const result = strings.shift().trim();
const match = re.exec(result);
assert.ok(match);
assert.strictEqual(match[1], test.output);
});
}

assert.strictEqual(process.stdout.writeTimes, tests.length);

Expand Down

0 comments on commit 55c423b

Please sign in to comment.