Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: do not use the same EventEmitter instance #35560

Merged
merged 1 commit into from
Oct 12, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions test/parallel/test-stream2-readable-wrap-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ const assert = require('assert');
const Readable = require('_stream_readable');
const EE = require('events').EventEmitter;

const oldStream = new EE();
oldStream.pause = () => {};
oldStream.resume = () => {};
class LegacyStream extends EE {
pause() {}
resume() {}
}

{
const err = new Error();
const oldStream = new LegacyStream();
const r = new Readable({ autoDestroy: true })
.wrap(oldStream)
.on('error', common.mustCall(() => {
Expand All @@ -23,6 +25,7 @@ oldStream.resume = () => {};

{
const err = new Error();
const oldStream = new LegacyStream();
const r = new Readable({ autoDestroy: false })
.wrap(oldStream)
.on('error', common.mustCall(() => {
Expand Down