mirror of
https://github.com/nodejs/node.git
synced 2025-04-30 15:41:06 +00:00

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: https://github.com/nodejs/node/pull/9889 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
19 lines
499 B
JavaScript
19 lines
499 B
JavaScript
'use strict';
|
|
// Simple tests of most basic domain functionality.
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
|
|
// timeouts call the callback directly from cc, so need to make sure the
|
|
// domain will be used regardless
|
|
setTimeout(function() {
|
|
const domain = require('domain');
|
|
const d = domain.create();
|
|
d.run(function() {
|
|
process.nextTick(function() {
|
|
console.trace('in nexttick', process.domain === d);
|
|
assert.strictEqual(process.domain, d);
|
|
});
|
|
});
|
|
}, 1);
|