Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Change equal to strictEqual and pass delay to setTimeout #9938

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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');
});