summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/compression/decompression-constructor-error.tentative.any.js
blob: 0270ba7353128c66f5c86f300cc7ec8aa3dc31bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// META: global=window,worker,shadowrealm

'use strict';

test(t => {
  assert_throws_js(TypeError, () => new DecompressionStream('a'), 'constructor should throw');
}, '"a" should cause the constructor to throw');

test(t => {
  assert_throws_js(TypeError, () => new DecompressionStream(), 'constructor should throw');
}, 'no input should cause the constructor to throw');

test(t => {
  assert_throws_js(Error, () => new DecompressionStream({ toString() { throw Error(); } }), 'constructor should throw');
}, 'non-string input should cause the constructor to throw');