diff options
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/unit/fetch_test.ts | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/cli/tests/unit/fetch_test.ts b/cli/tests/unit/fetch_test.ts index 86df4a1a9..0fbf01e6b 100644 --- a/cli/tests/unit/fetch_test.ts +++ b/cli/tests/unit/fetch_test.ts @@ -251,6 +251,25 @@ unitTest( unitTest( { perms: { net: true } }, + async function fetchMultipartFormBadContentType(): Promise<void> { + const response = await fetch( + "http://localhost:4545/multipart_form_bad_content_type", + ); + assert(response.body !== null); + + await assertThrowsAsync( + async (): Promise<void> => { + await response.formData(); + }, + TypeError, + "Invalid form data", + ); + await response.body.cancel(); + }, +); + +unitTest( + { perms: { net: true } }, async function fetchURLEncodedFormDataSuccess(): Promise<void> { const response = await fetch( "http://localhost:4545/cli/tests/subdir/form_urlencoded.txt", |