diff options
author | Aaron O'Mullan <aaron.omullan@gmail.com> | 2021-10-11 23:43:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-11 23:43:52 +0200 |
commit | 5bad8e17734ef8cc1f19df292d553cc1327638f3 (patch) | |
tree | 618fb5588aca5924686b431d4cc9932d16584fa6 /cli/tests | |
parent | 5508a0f45e233708f3a0a5fc9e9a48ab3c0fb33c (diff) |
perf(webidl): inline ResponseInit converter (#12285)
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/unit/response_test.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/cli/tests/unit/response_test.ts b/cli/tests/unit/response_test.ts index 3f6197e1f..9c6da1c5f 100644 --- a/cli/tests/unit/response_test.ts +++ b/cli/tests/unit/response_test.ts @@ -3,6 +3,7 @@ import { assert, assertEquals, assertStringIncludes, + assertThrows, unitTest, } from "./test_util.ts"; @@ -56,6 +57,23 @@ unitTest(async function responseFormData() { assertEquals([...formData], [...input]); }); +unitTest(function responseInvalidInit() { + // deno-lint-ignore ban-ts-comment + // @ts-expect-error + assertThrows(() => new Response("", 0)); + assertThrows(() => new Response("", { status: 0 })); + // deno-lint-ignore ban-ts-comment + // @ts-expect-error + assertThrows(() => new Response("", { status: null })); +}); + +unitTest(function responseNullInit() { + // deno-lint-ignore ban-ts-comment + // @ts-expect-error + const response = new Response("", null); + assertEquals(response.status, 200); +}); + unitTest(function customInspectFunction() { const response = new Response(); assertEquals( |