diff options
author | Zahidul Islam <zahidsharp@outlook.com> | 2017-04-22 12:48:30 -0700 |
---|---|---|
committer | Evan Lucas <evanlucas@me.com> | 2017-05-02 15:22:42 -0500 |
commit | d15b1c44460be7afbcd9159f5089a6228c1e6e86 (patch) | |
tree | cfafe23d9dccb19ee3c0fcd676d93b9990577937 | |
parent | 46a7c297d3a06a788574454f23ba76058d382bdf (diff) | |
download | node-new-d15b1c44460be7afbcd9159f5089a6228c1e6e86.tar.gz |
test: add mustCall in test-timers-clearImmediate
PR-URL: https://github.com/nodejs/node/pull/12598
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
-rw-r--r-- | test/parallel/test-timers-clearImmediate.js | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/test/parallel/test-timers-clearImmediate.js b/test/parallel/test-timers-clearImmediate.js index c49fd7622f..ccd9826bb0 100644 --- a/test/parallel/test-timers-clearImmediate.js +++ b/test/parallel/test-timers-clearImmediate.js @@ -1,18 +1,13 @@ 'use strict'; -require('../common'); -const assert = require('assert'); +const common = require('../common'); const N = 3; -let count = 0; + function next() { - const immediate = setImmediate(function() { - clearImmediate(immediate); - ++count; - }); + const fn = common.mustCall(() => clearImmediate(immediate)); + const immediate = setImmediate(fn); } -for (let i = 0; i < N; ++i) - next(); -process.on('exit', () => { - assert.strictEqual(count, N, `Expected ${N} immediate callback executions`); -}); +for (let i = 0; i < N; i++) { + next(); +} |