1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:07:35 +00:00

Tests/LibWeb: Verify setting {readable,writable}Type throws RangeError

This test proves that setting transformer.{readable,writable}Type to a
value throws a RangeError.
This commit is contained in:
Kenneth Myhra 2023-07-14 08:23:57 +02:00 committed by Andreas Kling
parent 221f18f72e
commit 1f4f750052
2 changed files with 21 additions and 0 deletions

View file

@ -0,0 +1,2 @@
'readableType' => Exception raised of RangeError
'writableType' => Exception raised of RangeError

View file

@ -0,0 +1,19 @@
<script src="../include.js"></script>
<script>
test(() => {
try {
new TransformStream({
readableType: 'bytes',
});
} catch (e) {
println(`'readableType' => Exception raised of ${e.constructor.name}`);
}
try {
new TransformStream({
writableType: 'bytes',
});
} catch (e) {
println(`'writableType' => Exception raised of ${e.constructor.name}`);
}
});
</script>