From 2ba4a101fd0b06a1e31d454ce83a1ce84e421901 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Fri, 11 Jun 2021 16:47:56 +0200 Subject: [PATCH] fixup: test --- test/parallel/test-stream-pipeline.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/parallel/test-stream-pipeline.js b/test/parallel/test-stream-pipeline.js index e2e5fe2e0d561a..a729e77218b183 100644 --- a/test/parallel/test-stream-pipeline.js +++ b/test/parallel/test-stream-pipeline.js @@ -1387,3 +1387,23 @@ const net = require('net'); assert.strictEqual(res, content); })); } + +{ + const writableLike = new EE(); + writableLike.writableNeedDrain = true; + + pipeline(async function *() {}, writableLike, + common.expectsError({ code: 'ERR_STREAM_PREMATURE_CLOSE' })); + + writableLike.emit('close'); +} + +{ + const writableLike = new EE(); + writableLike.write = () => false; + + pipeline(async function *() { yield null }, writableLike, + common.expectsError({ code: 'ERR_STREAM_PREMATURE_CLOSE' })); + + writableLike.emit('close'); +}