summaryrefslogtreecommitdiff
path: root/test/parallel/test-domain-fs-enoent-stream.js
blob: 9d28f3a1db4f839f78a1fa0a725e7ae765b2d94e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
'use strict';

const common = require('../common');
const assert = require('assert');
const domain = require('domain');
const fs = require('fs');

const d = new domain.Domain();

const fst = fs.createReadStream('stream for nonexistent file');

d.on('error', common.mustCall((err) => {
  assert.ok(err.message.match(/^ENOENT: no such file or directory, open '/));
  assert.strictEqual(err.domain, d);
  assert.strictEqual(err.domainEmitter, fst);
  assert.strictEqual(err.domainBound, undefined);
  assert.strictEqual(err.domainThrown, false);
}));

d.add(fst);