Skip to content

Commit

Permalink
test: refactor test-domain-from-timer
Browse files Browse the repository at this point in the history
In this change, the setTimeout needed a second argument, so I set that
value to 1. In addition, I changed the assertion to be a strictEquals
instead of equals.

I changed the var declarations to const in this test.

PR-URL: #9889
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
Daniel Sims authored and Trott committed Dec 7, 2016
1 parent ac78812 commit b0c10a2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/parallel/test-domain-from-timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
// Simple tests of most basic domain functionality.

require('../common');
var assert = require('assert');
const assert = require('assert');

// timeouts call the callback directly from cc, so need to make sure the
// domain will be used regardless
setTimeout(function() {
var domain = require('domain');
var d = domain.create();
const domain = require('domain');
const d = domain.create();
d.run(function() {
process.nextTick(function() {
console.trace('in nexttick', process.domain === d);
assert.equal(process.domain, d);
assert.strictEqual(process.domain, d);
});
});
});
}, 1);

0 comments on commit b0c10a2

Please sign in to comment.