From 501a31fcf3566788370e45bfb174547706f39337 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Tue, 24 Nov 2020 21:00:35 +0100 Subject: fix(op_crates/fetch): `redirect: "manual"` fetch should return `type: "default"` response (#8353) --- cli/tests/unit/fetch_test.ts | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'cli') diff --git a/cli/tests/unit/fetch_test.ts b/cli/tests/unit/fetch_test.ts index 681eefad4..99b7531a3 100644 --- a/cli/tests/unit/fetch_test.ts +++ b/cli/tests/unit/fetch_test.ts @@ -693,18 +693,10 @@ unitTest( const response = await fetch("http://localhost:4546/", { redirect: "manual", }); // will redirect to http://localhost:4545/ - assertEquals(response.status, 0); - assertEquals(response.statusText, ""); - assertEquals(response.url, ""); - assertEquals(response.type, "opaqueredirect"); - try { - await response.text(); - fail( - "Reponse.text() didn't throw on a filtered response without a body (type opaqueredirect)", - ); - } catch (e) { - return; - } + assertEquals(response.status, 301); + assertEquals(response.url, "http://localhost:4546/"); + assertEquals(response.type, "default"); + assertEquals(response.headers.get("Location"), "http://localhost:4545/"); }, ); -- cgit v1.2.3