diff options
author | Aaron O'Mullan <aaron.omullan@gmail.com> | 2021-04-21 23:03:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-21 23:03:04 +0200 |
commit | 8d0e0ead51d523c35c7d6b423510c9df8ba1339c (patch) | |
tree | 3b8c1630bc365d177623c4ec620a9f5b3d4c0ce3 | |
parent | 21372d7b25141d5edb662d87e5842744ca23e8b5 (diff) |
fix(fetch): Response inspect regression (#10295)
-rw-r--r-- | cli/tests/unit/response_test.ts | 17 | ||||
-rw-r--r-- | op_crates/fetch/23_response.js | 2 |
2 files changed, 18 insertions, 1 deletions
diff --git a/cli/tests/unit/response_test.ts b/cli/tests/unit/response_test.ts index 096eefc6d..9993eb925 100644 --- a/cli/tests/unit/response_test.ts +++ b/cli/tests/unit/response_test.ts @@ -50,3 +50,20 @@ unitTest({ ignore: true }, async function responseFormData() { assert(formData instanceof FormData); assertEquals(formData, input); }); + +unitTest(function customInspectFunction(): void { + const response = new Response(); + assertEquals( + Deno.inspect(response), + `Response { + body: null, + bodyUsed: false, + headers: Headers {}, + ok: true, + redirected: false, + status: 200, + statusText: "", + url: "" +}`, + ); +}); diff --git a/op_crates/fetch/23_response.js b/op_crates/fetch/23_response.js index 44b74f789..42d16d44e 100644 --- a/op_crates/fetch/23_response.js +++ b/op_crates/fetch/23_response.js @@ -357,7 +357,7 @@ redirected: this.redirected, status: this.status, statusText: this.statusText, - url: this.url(), + url: this.url, }; return `Response ${inspect(inner)}`; } |