diff --git a/test/parallel/test-whatwg-webstreams-adapters-streambase.js b/test/parallel/test-whatwg-webstreams-adapters-streambase.js index 43d28f0499d..bd864ab8c14 100644 --- a/test/parallel/test-whatwg-webstreams-adapters-streambase.js +++ b/test/parallel/test-whatwg-webstreams-adapters-streambase.js @@ -65,3 +65,12 @@ const { const readable = newReadableStreamFromStreamBase(stream); readable.cancel().then(common.mustCall()); } + +{ + const stream = new JSStream(); + stream.onread = common.mustCall(); + assert.throws(() => newReadableStreamFromStreamBase(stream), { + code: 'ERR_INVALID_STATE' + }); + stream.emitEOF(); +} diff --git a/test/parallel/test-whatwg-webstreams-adapters-to-readablewritablepair.js b/test/parallel/test-whatwg-webstreams-adapters-to-readablewritablepair.js index 83d21247a49..5062b9e179a 100644 --- a/test/parallel/test-whatwg-webstreams-adapters-to-readablewritablepair.js +++ b/test/parallel/test-whatwg-webstreams-adapters-to-readablewritablepair.js @@ -248,3 +248,9 @@ const { reader.closed.then(common.mustCall()); writer.close().then(common.mustCall()); } + +{ + assert.throws(() => newReadableWritablePairFromDuplex(null), { + code: 'ERR_INVALID_ARG_TYPE' + }); +} diff --git a/test/parallel/test-whatwg-webstreams-adapters-to-streamduplex.js b/test/parallel/test-whatwg-webstreams-adapters-to-streamduplex.js index 15ac9f83271..9c92a4778a0 100644 --- a/test/parallel/test-whatwg-webstreams-adapters-to-streamduplex.js +++ b/test/parallel/test-whatwg-webstreams-adapters-to-streamduplex.js @@ -164,3 +164,21 @@ const { duplex.end(); } + +{ + const transform = { readable: {}, writable: {} }; + assert.throws(() => newStreamDuplexFromReadableWritablePair(transform), { + code: 'ERR_INVALID_ARG_TYPE' + }); +} + +{ + const transform = { + readable: new ReadableStream(), + writable: null + }; + + assert.throws(() => newStreamDuplexFromReadableWritablePair(transform), { + code: 'ERR_INVALID_ARG_TYPE', + }); +}