summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/tests/unit/response_test.ts17
-rw-r--r--op_crates/fetch/23_response.js2
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)}`;
}