summaryrefslogtreecommitdiff
path: root/cli/tests/unit/request_test.ts
diff options
context:
space:
mode:
authorLuca Casonato <lucacasonato@yahoo.com>2021-04-20 14:47:22 +0200
committerGitHub <noreply@github.com>2021-04-20 14:47:22 +0200
commit9e6cd91014ac4a0d34556b0d09cbe25e4e0930c6 (patch)
tree4523790510a17676c987039feb03f208a258dc16 /cli/tests/unit/request_test.ts
parent115197ffb06aad2a3045e8478980ab911b5a5eeb (diff)
chore: align fetch to spec (#10203)
This commit aligns the `fetch` API and the `Request` / `Response` classes belonging to it to the spec. This commit enables all the relevant `fetch` WPT tests. Spec compliance is now at around 90%. Performance is essentially identical now (within 1% of 1.9.0).
Diffstat (limited to 'cli/tests/unit/request_test.ts')
-rw-r--r--cli/tests/unit/request_test.ts15
1 files changed, 3 insertions, 12 deletions
diff --git a/cli/tests/unit/request_test.ts b/cli/tests/unit/request_test.ts
index a8cbed370..7c4fa4ad0 100644
--- a/cli/tests/unit/request_test.ts
+++ b/cli/tests/unit/request_test.ts
@@ -15,17 +15,6 @@ unitTest(async function fromInit(): Promise<void> {
assertEquals(req.headers.get("test-header"), "value");
});
-unitTest(async function fromRequest(): Promise<void> {
- const r = new Request("http://foo/", { body: "ahoyhoy" });
- r.headers.set("test-header", "value");
-
- const req = new Request(r);
-
- assertEquals(await r.text(), await req.text());
- assertEquals(req.url, r.url);
- assertEquals(req.headers.get("test-header"), r.headers.get("test-header"));
-});
-
unitTest(function requestNonString(): void {
const nonString = {
toString() {
@@ -50,9 +39,11 @@ unitTest(function requestRelativeUrl(): void {
unitTest(async function cloneRequestBodyStream(): Promise<void> {
// hack to get a stream
- const stream = new Request("http://foo/", { body: "a test body" }).body;
+ const stream =
+ new Request("http://foo/", { body: "a test body", method: "POST" }).body;
const r1 = new Request("http://foo/", {
body: stream,
+ method: "POST",
});
const r2 = r1.clone();