Skip to content

Commit f51cb1c

Browse files
karszawaMylesBorins
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 3f4d0fc commit f51cb1c

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
@@ -54,12 +54,12 @@ const inputs = [
5454
consttimeouts=[];
5555
constintervals=[];
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-
consthandle=setInterval(function(){
62+
consthandle=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)