From 1c4a9665e2a2ff85ccb8060f168dafafa4d2194b Mon Sep 17 00:00:00 2001 From: Marcos Casagrande Date: Mon, 25 May 2020 15:26:36 +0200 Subject: fix: Allow ArrayBuffer as Fetch request body (#5831) --- cli/tests/unit/fetch_test.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'cli/tests/unit/fetch_test.ts') 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 @@ -258,6 +258,19 @@ unitTest( } ); +unitTest( + { perms: { net: true } }, + async function fetchInitArrayBufferBody(): Promise { + 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 { -- cgit v1.2.3