Skip to content

Commit

Permalink
test: test streambase already has a consumer
Browse files Browse the repository at this point in the history
  • Loading branch information
MrJithil committed May 18, 2023
1 parent 05693ac commit ae09e10
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/parallel/test-whatwg-webstreams-adapters-streambase.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,12 @@ const {
const readable = newReadableStreamFromStreamBase(stream);
readable.cancel().then(common.mustCall());
}

{
const stream = new JSStream();
stream.onread = () => {};
assert.throws(() => newReadableStreamFromStreamBase(stream), {
code: 'ERR_INVALID_STATE',
message: /StreamBase already has a consumer/
});
}

0 comments on commit ae09e10

Please sign in to comment.