summaryrefslogtreecommitdiff
path: root/cli/tests/unit/fetch_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit/fetch_test.ts')
-rw-r--r--cli/tests/unit/fetch_test.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/cli/tests/unit/fetch_test.ts b/cli/tests/unit/fetch_test.ts
index 458c34ae2..db4c3a407 100644
--- a/cli/tests/unit/fetch_test.ts
+++ b/cli/tests/unit/fetch_test.ts
@@ -260,6 +260,19 @@ unitTest(
unitTest(
{ perms: { net: true } },
+ async function fetchInitArrayBufferBody(): Promise<void> {
+ const data = "Hello World";
+ const response = await fetch("http://localhost:4545/echo_server", {
+ method: "POST",
+ body: new TextEncoder().encode(data).buffer,
+ });
+ const text = await response.text();
+ assertEquals(text, data);
+ }
+);
+
+unitTest(
+ { perms: { net: true } },
async function fetchInitURLSearchParamsBody(): Promise<void> {
const data = "param1=value1&param2=value2";
const params = new URLSearchParams(data);