8000 fix: Exclude `domainEmitter` from output (#26) · gulpjs/plugin-error@2a89513 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2a89513

Browse files
authored
fix: Exclude domainEmitter from output (#26)
1 parent 65e5b6d commit 2a89513

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ var ignored = new Set(
1010
'showProperties',
1111
'showStack',
1212
'domain',
13+
'domainEmitter',
1314
'domainThrown',
1415
])
1516
);

test/index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,19 @@ describe('PluginError()', function () {
252252
done();
253253
});
254254

255+
it('should not show additional properties added by a domain', function (done) {
256+
var Duplex = require('stream').Duplex;
257+
var stream = new Duplex({ objectMode: true });
258+
var domain = require('domain').create();
259+
domain.add(stream);
260+
domain.on('error', function (err) {
261+
expect(err).toBeInstanceOf(PluginError);
262+
expect(err.toString()).not.toContain('domain');
263+
done();
264+
});
265+
stream.emit('error', new PluginError('plugin', 'message'));
266+
});
267+
255268
it('should not modify error argument', function (done) {
256269
var realErr = { message: 'something broke' };
257270
new PluginError('test', realErr);

0 commit comments

Comments
 (0)
0