diff options
Diffstat (limited to 'test/parallel/test-next-tick.js')
-rw-r--r-- | test/parallel/test-next-tick.js | 35 |
1 files changed, 11 insertions, 24 deletions
diff --git a/test/parallel/test-next-tick.js b/test/parallel/test-next-tick.js index 8b45e8c705..2a98b46da1 100644 --- a/test/parallel/test-next-tick.js +++ b/test/parallel/test-next-tick.js @@ -1,28 +1,18 @@ 'use strict'; -require('../common'); +const common = require('../common'); var assert = require('assert'); -var complete = 0; +process.nextTick(common.mustCall(function() { + process.nextTick(common.mustCall(function() { + process.nextTick(common.mustCall(function() {})); + })); +})); -process.nextTick(function() { - complete++; - process.nextTick(function() { - complete++; - process.nextTick(function() { - complete++; - }); - }); -}); - -setTimeout(function() { - process.nextTick(function() { - complete++; - }); -}, 50); +setTimeout(common.mustCall(function() { + process.nextTick(common.mustCall(function() {})); +}), 50); -process.nextTick(function() { - complete++; -}); +process.nextTick(common.mustCall(function() {})); var obj = {}; @@ -32,8 +22,5 @@ process.nextTick(function(a, b) { }, 42, obj); process.on('exit', function() { - assert.equal(5, complete); - process.nextTick(function() { - throw new Error('this should not occur'); - }); + process.nextTick(common.fail); }); |