2015-05-19 13:00:06 +02:00
|
|
|
'use strict';
|
2013-03-26 06:32:41 +01:00
|
|
|
// Simple tests of most basic domain functionality.
|
|
|
|
|
2015-12-24 01:02:12 +01:00
|
|
|
require('../common');
|
2013-03-26 06:32:41 +01:00
|
|
|
var 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();
|
|
|
|
d.run(function() {
|
|
|
|
process.nextTick(function() {
|
2015-05-19 13:00:06 +02:00
|
|
|
console.trace('in nexttick', process.domain === d);
|
2013-03-26 06:32:41 +01:00
|
|
|
assert.equal(process.domain, d);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|