summaryrefslogtreecommitdiff
path: root/js/request_test.ts
blob: e9e1f5164c6a2181dd9d8cc865b58f98b9d8bb4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { test, assertEquals } from "./test_util.ts";

test(function fromInit(): void {
  const req = new Request("https://example.com", {
    body: "ahoyhoy",
    method: "POST",
    headers: {
      "test-header": "value"
    }
  });

  // @ts-ignore
  assertEquals("ahoyhoy", req._bodySource);
  assertEquals(req.url, "https://example.com");
  assertEquals(req.headers.get("test-header"), "value");
});