Skip to content

Commit de99726

Browse files
Chris Henneyaddaleax
Chris Henney
authored andcommitted
test: refactor test-domain-exit-dispose
change equal to strictEqual, fix setTimeout PR-URL: #9938 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
1 parent 5ca9077 commit de99726

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

test/parallel/test-domain-exit-dispose.js

+3-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
22
require('../common');
3+
var common = require('../common');
34
var assert = require('assert');
45
var domain = require('domain');
5-
var disposalFailed = false;
66

77
// no matter what happens, we should increment a 10 times.
88
var a = 0;
@@ -22,11 +22,7 @@ function err() {
2222
function err2() {
2323
// this timeout should never be called, since the domain gets
2424
// disposed when the error happens.
25-
setTimeout(function() {
26-
console.error('This should not happen.');
27-
disposalFailed = true;
28-
process.exit(1);
29-
});
25+
setTimeout(common.mustCall(() => {}, 0), 1);
3026

3127
// this function doesn't exist, and throws an error as a result.
3228
err3(); // eslint-disable-line no-undef
@@ -41,7 +37,6 @@ function err() {
4137
}
4238

4339
process.on('exit', function() {
44-
assert.equal(a, 10);
45-
assert.equal(disposalFailed, false);
40+
assert.strictEqual(a, 10);
4641
console.log('ok');
4742
});

0 commit comments

Comments
 (0)