diff options
author | Luca Casonato <hello@lcas.dev> | 2021-07-20 00:11:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-20 00:11:50 +0200 |
commit | 55632266e9f84b456626d3536b4e2ee8365f600f (patch) | |
tree | 7f1192da61f94819705059a687d9df4d6c9251d4 /cli/tests/unit/response_test.ts | |
parent | 7d69f06db88cf022f2c5c6e0b04493af7b50a98b (diff) |
tests: re-enable disabled Response.formData test (#11453)
Diffstat (limited to 'cli/tests/unit/response_test.ts')
-rw-r--r-- | cli/tests/unit/response_test.ts | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/cli/tests/unit/response_test.ts b/cli/tests/unit/response_test.ts index 1faf8991a..c1ef80fb6 100644 --- a/cli/tests/unit/response_test.ts +++ b/cli/tests/unit/response_test.ts @@ -43,18 +43,17 @@ unitTest(async function responseBlob() { assertEquals(await blob.arrayBuffer(), new Uint8Array([1, 2, 3]).buffer); }); -// TODO(lucacasonato): re-enable test once #10002 is fixed. -unitTest({ ignore: true }, async function responseFormData() { +unitTest(async function responseFormData() { const input = new FormData(); input.append("hello", "world"); - const response = new Response(input, { - headers: { "content-type": "application/x-www-form-urlencoded" }, - }); + const response = new Response(input); + const contentType = response.headers.get("content-type")!; + assert(contentType.startsWith("multipart/form-data")); const formDataPromise = response.formData(); assert(formDataPromise instanceof Promise); const formData = await formDataPromise; assert(formData instanceof FormData); - assertEquals(formData, input); + assertEquals([...formData], [...input]); }); unitTest(function customInspectFunction(): void { |