Skip to content

Commit

Permalink
Test whether WritableStream constructor throws when given a type
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiasBuelens authored and domenic committed Dec 3, 2024
1 parent b9da54d commit e98c091
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions streams/writable-streams/constructor.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ test(() => {
new WritableStream();
}, 'WritableStream should be constructible with no arguments');

test(() => {
assert_throws_js(RangeError, () => new WritableStream({ type: 'bytes' }), 'constructor should throw');
}, `WritableStream can't be constructed with a defined type`);

test(() => {
const underlyingSink = { get start() { throw error1; } };
const queuingStrategy = { highWaterMark: 0, get size() { throw error2; } };
Expand Down

0 comments on commit e98c091

Please sign in to comment.