Skip to content

Commit

Permalink
test: replace function with arrow function
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
karszawa authored and gibfahn committed Dec 19, 2017
1 parent c0c3666 commit 0ef4f78
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/parallel/test-timers.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ const inputs = [
const timeouts = [];
const intervals = [];

inputs.forEach(function(value, index) {
setTimeout(function() {
inputs.forEach((value, index) => {
setTimeout(() => {
timeouts[index] = true;
}, value);

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

setTimeout(common.mustCall(function() {
setTimeout(common.mustCall(() => {
// assert that all other timers have run
inputs.forEach(function(value, index) {
inputs.forEach((value, index) => {
assert.strictEqual(true, timeouts[index]);
assert.strictEqual(true, intervals[index]);
});
Expand Down

0 comments on commit 0ef4f78

Please sign in to comment.