From b05a3583fd64274dcd8cc59543dc511b7ee6f7ff Mon Sep 17 00:00:00 2001 From: rupakshi1999 Date: Fri, 22 Sep 2023 14:37:06 -0400 Subject: [PATCH 1/2] test: Replace forEach() with for ... of in test-util-log.js Refs:https://docs.google.com/spreadsheets/d/1kjaxxXX2zGgJUoqj-7U3EYf_0dvSuI-N6YPan4Hye_4/edit#gid=0 --- test/parallel/test-util-log.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-util-log.js b/test/parallel/test-util-log.js index 854746290ec796..1676cf299b5315 100644 --- a/test/parallel/test-util-log.js +++ b/test/parallel/test-util-log.js @@ -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); From cf230b245671cb89194bfc2a62f9f1a52648ecc9 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Sat, 21 Oct 2023 16:28:15 +0200 Subject: [PATCH 2/2] Update test/parallel/test-util-log.js --- test/parallel/test-util-log.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-util-log.js b/test/parallel/test-util-log.js index 1676cf299b5315..838828e50f32b0 100644 --- a/test/parallel/test-util-log.js +++ b/test/parallel/test-util-log.js @@ -53,7 +53,7 @@ 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} - (.+)$/; -for(const test of tests) { +for (const test of tests) { util.log(test.input); const result = strings.shift().trim(); const match = re.exec(result);