Skip to content

Commit ae09e10

Browse files
committed
test: test streambase already has a consumer
1 parent 05693ac commit ae09e10

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/parallel/test-whatwg-webstreams-adapters-streambase.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,12 @@ const {
6565
const readable = newReadableStreamFromStreamBase(stream);
6666
readable.cancel().then(common.mustCall());
6767
}
68+
69+
{
70+
const stream = new JSStream();
71+
stream.onread = () => {};
72+
assert.throws(() => newReadableStreamFromStreamBase(stream), {
73+
code: 'ERR_INVALID_STATE',
74+
message: /StreamBase already has a consumer/
75+
});
76+
}

0 commit comments

Comments
 (0)