Skip to content

Commit

Permalink
Fix stream-related tests with Node 22.5.0 (#1136)
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky authored Jul 22, 2024
1 parent 6c6e861 commit f9f7140
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
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));

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

0 comments on commit f9f7140

Please sign in to comment.