Skip to content

Commit f51cb1c

Browse files
karszawaMylesBorins
authored andcommitted
test: replace function with arrow function
PR-URL: #17308 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 3f4d0fc commit f51cb1c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/parallel/test-timers.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ const inputs = [
5454
const timeouts = [];
5555
const intervals = [];
5656

57-
inputs.forEach(function(value, index) {
58-
setTimeout(function() {
57+
inputs.forEach((value, index) => {
58+
setTimeout(() => {
5959
timeouts[index] = true;
6060
}, value);
6161

62-
const handle = setInterval(function() {
62+
const handle = setInterval(() => {
6363
clearInterval(handle); // disarm timer or we'll never finish
6464
intervals[index] = true;
6565
}, value);
@@ -68,9 +68,9 @@ inputs.forEach(function(value, index) {
6868
// All values in inputs array coerce to 1 ms. Therefore, they should all run
6969
// before a timer set here for 2 ms.
7070

71-
setTimeout(common.mustCall(function() {
71+
setTimeout(common.mustCall(() => {
7272
// assert that all other timers have run
73-
inputs.forEach(function(value, index) {
73+
inputs.forEach((value, index) => {
7474
assert(timeouts[index]);
7575
assert(intervals[index]);
7676
});

0 commit comments

Comments
 (0)