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

Fix stream-related tests with Node 22.5.0 #1136

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions test/convert/duplex.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,12 @@ test('.duplex() can pipe to errored stream with Stream.pipeline()', async t => {
outputStream.destroy(cause);

await assertPromiseError(t, pipeline(inputStream, stream, outputStream), cause);
await t.throwsAsync(finishedStream(stream));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ehmicky hope you are doing well!

I just came from the linked PR and I am wondering if you could let me know why this fix the tests (I tried to access the failure log but seems they aren't available anymore) cheers!


await assertStreamError(t, inputStream, cause);
const error = await assertStreamError(t, stream, {cause});
const error = await assertStreamError(t, stream, cause);
await assertStreamReadError(t, outputStream, cause);
await assertSubprocessError(t, subprocess, error);
await assertSubprocessError(t, subprocess, {cause: error});
});

test('.duplex() can be piped to errored stream with Stream.pipeline()', async t => {
Expand All @@ -166,11 +167,12 @@ test('.duplex() can be piped to errored stream with Stream.pipeline()', async t
inputStream.destroy(cause);

await assertPromiseError(t, pipeline(inputStream, stream, outputStream), cause);
await t.throwsAsync(finishedStream(stream));

await assertStreamError(t, inputStream, cause);
const error = await assertStreamError(t, stream, {cause});
const error = await assertStreamError(t, stream, cause);
await assertStreamReadError(t, outputStream, cause);
await assertSubprocessError(t, subprocess, error);
await assertSubprocessError(t, subprocess, {cause: error});
});

test('.duplex() can be used with Stream.compose()', async t => {
Expand Down
5 changes: 3 additions & 2 deletions test/convert/readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,11 @@ test('.readable() can pipe to errored stream with Stream.pipeline()', async t =>
outputStream.destroy(cause);

await assertPromiseError(t, pipeline(stream, outputStream), cause);
await t.throwsAsync(finishedStream(stream));

const error = await assertStreamError(t, stream, {cause});
const error = await assertStreamError(t, stream, cause);
await assertStreamReadError(t, outputStream, cause);
await assertSubprocessError(t, subprocess, error);
await assertSubprocessError(t, subprocess, {cause: error});
});

test('.readable() can be used with Stream.compose()', async t => {
Expand Down
5 changes: 3 additions & 2 deletions test/convert/writable.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,11 @@ test('.writable() can pipe to errored stream with Stream.pipeline()', async t =>
inputStream.destroy(cause);

await assertPromiseError(t, pipeline(inputStream, stream), cause);
await t.throwsAsync(finishedStream(stream));

await assertStreamError(t, inputStream, cause);
const error = await assertStreamError(t, stream, {cause});
await assertSubprocessError(t, subprocess, error);
const error = await assertStreamError(t, stream, cause);
await assertSubprocessError(t, subprocess, {cause: error});
});

test('.writable() can be used with Stream.compose()', async t => {
Expand Down