Skip to content

Commit 0ef4f78

Browse files
karszawagibfahn
authored andcommitted
test: replace function with arrow function
PR-URL: #17308 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent c0c3666 commit 0ef4f78

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/parallel/test-timers.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ const inputs = [
3333
const timeouts = [];
3434
const intervals = [];
3535

36-
inputs.forEach(function(value, index) {
37-
setTimeout(function() {
36+
inputs.forEach((value, index) => {
37+
setTimeout(() => {
3838
timeouts[index] = true;
3939
}, value);
4040

41-
const handle = setInterval(function() {
41+
const handle = setInterval(() => {
4242
clearInterval(handle); // disarm timer or we'll never finish
4343
intervals[index] = true;
4444
}, value);
@@ -47,9 +47,9 @@ inputs.forEach(function(value, index) {
4747
// All values in inputs array coerce to 1 ms. Therefore, they should all run
4848
// before a timer set here for 2 ms.
4949

50-
setTimeout(common.mustCall(function() {
50+
setTimeout(common.mustCall(() => {
5151
// assert that all other timers have run
52-
inputs.forEach(function(value, index) {
52+
inputs.forEach((value, index) => {
5353
assert.strictEqual(true, timeouts[index]);
5454
assert.strictEqual(true, intervals[index]);
5555
});

0 commit comments

Comments
 (0)