summaryrefslogtreecommitdiff
path: root/cli/js/tests/fetch_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/tests/fetch_test.ts')
-rw-r--r--cli/js/tests/fetch_test.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/cli/js/tests/fetch_test.ts b/cli/js/tests/fetch_test.ts
index 146709583..9a705c40a 100644
--- a/cli/js/tests/fetch_test.ts
+++ b/cli/js/tests/fetch_test.ts
@@ -288,6 +288,20 @@ unitTest({ perms: { net: true } }, async function fetchInitBlobBody(): Promise<
assert(response.headers.get("content-type")!.startsWith("text/javascript"));
});
+unitTest(
+ { perms: { net: true } },
+ async function fetchInitFormDataBody(): Promise<void> {
+ const form = new FormData();
+ form.append("field", "value");
+ const response = await fetch("http://localhost:4545/echo_server", {
+ method: "POST",
+ body: form
+ });
+ const resultForm = await response.formData();
+ assertEquals(form.get("field"), resultForm.get("field"));
+ }
+);
+
unitTest({ perms: { net: true } }, async function fetchUserAgent(): Promise<
void
> {