Skip to content

Commit 543ce4e

Browse files
test fixup
Signed-off-by: marcopiraccini <marco.piraccini@gmail.com>
1 parent 0dc1ebc commit 543ce4e

File tree

1 file changed

+16
-20
lines changed

1 file changed

+16
-20
lines changed

test/parallel/test-stream-pipeline.js

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1753,24 +1753,20 @@ tmpdir.refresh();
17531753
{
17541754
// Errors thrown in Readable.map inside pipeline should not be
17551755
// swallowed by AbortError when the source is an infinite stream.
1756-
async function run() {
1757-
await assert.rejects(
1758-
pipelinep(
1759-
new Readable({ read() { this.push('data'); } }),
1760-
new Transform({
1761-
readableObjectMode: true,
1762-
transform(chunk, encoding, callback) {
1763-
this.push({});
1764-
callback();
1765-
},
1766-
}),
1767-
(readable) => readable.map(async () => {
1768-
throw new Error('Boom!');
1769-
}),
1770-
),
1771-
{ message: 'Boom!' },
1772-
);
1773-
}
1774-
1775-
run().then(common.mustCall());
1756+
pipeline(
1757+
new Readable({ read() { this.push('data'); } }),
1758+
new Transform({
1759+
readableObjectMode: true,
1760+
transform(chunk, encoding, callback) {
1761+
this.push({});
1762+
callback();
1763+
},
1764+
}),
1765+
(readable) => readable.map(async () => {
1766+
throw new Error('Boom!');
1767+
}),
1768+
common.mustCall((err) => {
1769+
assert.strictEqual(err.message, 'Boom!');
1770+
}),
1771+
);
17761772
}

0 commit comments

Comments
 (0)