mirror of
https://github.com/nodejs/node.git
synced 2025-04-28 21:46:48 +00:00

Split up test-domain into multiple, more focused test files and use more modern JS inside of them. PR-URL: https://github.com/nodejs/node/pull/13614 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
21 lines
561 B
JavaScript
21 lines
561 B
JavaScript
'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);
|