summaryrefslogtreecommitdiff
path: root/test/parallel/test-domain-from-timer.js
blob: 2ffae758ef6490c028cf48c4f51562791d186930 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
'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);