Skip to content

Commit 0dc1ebc

Browse files
stream: fix lint error in pipeline test
Signed-off-by: marcopiraccini <marco.piraccini@gmail.com>
1 parent a581189 commit 0dc1ebc

File tree

1 file changed

+18
-25
lines changed

1 file changed

+18
-25
lines changed

test/parallel/test-stream-pipeline.js

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1753,31 +1753,24 @@ 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-
function createInfiniteReadable() {
1757-
return new Readable({
1758-
read() {
1759-
this.push('data');
1760-
},
1761-
});
1762-
}
1763-
1764-
function createObjectTransform() {
1765-
return new Transform({
1766-
readableObjectMode: true,
1767-
transform(chunk, encoding, callback) {
1768-
this.push({});
1769-
callback();
1770-
},
1771-
});
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+
);
17721773
}
17731774

1774-
pipelinep(
1775-
createInfiniteReadable(),
1776-
createObjectTransform(),
1777-
(readable) => readable.map(async () => {
1778-
throw new Error('Boom!');
1779-
}),
1780-
).then(common.mustNotCall(), common.mustCall((err) => {
1781-
assert.strictEqual(err.message, 'Boom!');
1782-
}));
1775+
run().then(common.mustCall());
17831776
}

0 commit comments

Comments
 (0)