diff --git a/cli/tests/unit/response_test.ts b/cli/tests/unit/response_test.ts index 096eefc6dd..9993eb9257 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 44b74f789c..42d16d44e1 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)}`; }