From 60ac964d2366f3bb410944eb64e5a8ec8a2d9157 Mon Sep 17 00:00:00 2001 From: Zahidul Islam Date: Sat, 22 Apr 2017 12:48:30 -0700 Subject: [PATCH 1/4] test: adding mustCall in test-timers-clearImmediate.js --- test/parallel/test-timers-clearImmediate.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/test/parallel/test-timers-clearImmediate.js b/test/parallel/test-timers-clearImmediate.js index c49fd7622f4ab6..35dc4717381786 100644 --- a/test/parallel/test-timers-clearImmediate.js +++ b/test/parallel/test-timers-clearImmediate.js @@ -1,18 +1,12 @@ 'use strict'; -require('../common'); +const common = require('../common'); const assert = require('assert'); const N = 3; let count = 0; function next() { - const immediate = setImmediate(function() { + const immediate = setImmediate(common.mustCall(() => { clearImmediate(immediate); ++count; - }); + }, 3)); } -for (let i = 0; i < N; ++i) - next(); - -process.on('exit', () => { - assert.strictEqual(count, N, `Expected ${N} immediate callback executions`); -}); From 8f439e23c5a528c72240402c94d5aeff958a2961 Mon Sep 17 00:00:00 2001 From: Zahidul Islam Date: Sat, 22 Apr 2017 13:03:19 -0700 Subject: [PATCH 2/4] test: update test-times-clearImmediate.js --- test/parallel/test-timers-clearImmediate.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-timers-clearImmediate.js b/test/parallel/test-timers-clearImmediate.js index 35dc4717381786..5c9764b0029cf8 100644 --- a/test/parallel/test-timers-clearImmediate.js +++ b/test/parallel/test-timers-clearImmediate.js @@ -8,5 +8,9 @@ function next() { const immediate = setImmediate(common.mustCall(() => { clearImmediate(immediate); ++count; - }, 3)); + })); } + +for(let i = 0; i < N; i++) { + next(); +} \ No newline at end of file From 69222b55d2882f899a919f09d9962679b885e888 Mon Sep 17 00:00:00 2001 From: Zahidul Islam Date: Sat, 22 Apr 2017 13:07:50 -0700 Subject: [PATCH 3/4] test: update test-times-clearImmediate.js --- test/parallel/test-timers-clearImmediate.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/parallel/test-timers-clearImmediate.js b/test/parallel/test-timers-clearImmediate.js index 5c9764b0029cf8..45fd10e6a271c3 100644 --- a/test/parallel/test-timers-clearImmediate.js +++ b/test/parallel/test-timers-clearImmediate.js @@ -3,12 +3,9 @@ const common = require('../common'); const assert = require('assert'); const N = 3; -let count = 0; + function next() { - const immediate = setImmediate(common.mustCall(() => { - clearImmediate(immediate); - ++count; - })); + const immediate = setImmediate(common.mustCall(() => clearImmediate(immediate))); } for(let i = 0; i < N; i++) { From 6eb7161016bb352ae322f1b618dd39cc56fb8d30 Mon Sep 17 00:00:00 2001 From: Zahidul Islam Date: Sat, 22 Apr 2017 13:36:18 -0700 Subject: [PATCH 4/4] test: fixing lint error in test-times-clearImmediate.js --- test/parallel/test-timers-clearImmediate.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-timers-clearImmediate.js b/test/parallel/test-timers-clearImmediate.js index 45fd10e6a271c3..44a8f59d428c7a 100644 --- a/test/parallel/test-timers-clearImmediate.js +++ b/test/parallel/test-timers-clearImmediate.js @@ -1,13 +1,14 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); const N = 3; function next() { - const immediate = setImmediate(common.mustCall(() => clearImmediate(immediate))); + const immediate = setImmediate( + common.mustCall(() => clearImmediate(immediate)) + ); } -for(let i = 0; i < N; i++) { +for (let i = 0; i < N; i++) { next(); -} \ No newline at end of file +}