1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-01 09:24:20 -04:00
denoland-deno/js/request_test.ts

18 lines
480 B
TypeScript
Raw Normal View History

2019-05-01 23:56:42 -04:00
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { test, assertEquals } from "./test_util.ts";
2019-05-01 23:56:42 -04:00
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");
});