Skip to content

Commit

Permalink
test: refactor test-domain-exit-dispose
Browse files Browse the repository at this point in the history
change equal to strictEqual, fix setTimeout

PR-URL: #9938
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
  • Loading branch information
Chris Henney authored and MylesBorins committed Dec 20, 2016
1 parent a896d4e commit a64f406
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions test/parallel/test-domain-exit-dispose.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';
require('../common');
var common = require('../common');
var assert = require('assert');
var domain = require('domain');
var disposalFailed = false;

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

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

process.on('exit', function() {
assert.equal(a, 10);
assert.equal(disposalFailed, false);
assert.strictEqual(a, 10);
console.log('ok');
});

0 comments on commit a64f406

Please sign in to comment.