summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/unit/fetch_test.ts2
-rw-r--r--cli/tests/unit/response_test.ts11
2 files changed, 6 insertions, 7 deletions
diff --git a/cli/tests/unit/fetch_test.ts b/cli/tests/unit/fetch_test.ts
index 24a820dba..45ab2d12c 100644
--- a/cli/tests/unit/fetch_test.ts
+++ b/cli/tests/unit/fetch_test.ts
@@ -275,7 +275,7 @@ unitTest(
await response.formData();
},
TypeError,
- "Invalid form data",
+ "Body can not be decoded as form data",
);
},
);
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 {