diff options
| author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2021-01-07 18:06:08 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-07 19:06:08 +0100 |
| commit | e61e81eb57351782862aa50775ce4348f10b1856 (patch) | |
| tree | 6099aa60857f586774a195034f18ac1fb10ca519 /cli/tests/unit/request_test.ts | |
| parent | c347dfcd565c3a396ae84dff46e7374851913462 (diff) | |
feat: add --location=<href> and globalThis.location (#7369)
Diffstat (limited to 'cli/tests/unit/request_test.ts')
| -rw-r--r-- | cli/tests/unit/request_test.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/cli/tests/unit/request_test.ts b/cli/tests/unit/request_test.ts index 8132e0184..da6a0e15b 100644 --- a/cli/tests/unit/request_test.ts +++ b/cli/tests/unit/request_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { assert, assertEquals, assertThrows, unitTest } from "./test_util.ts"; +import { assert, assertEquals, unitTest } from "./test_util.ts"; unitTest(function fromInit(): void { const req = new Request("http://foo/", { @@ -46,8 +46,10 @@ unitTest(function methodNonString(): void { }); unitTest(function requestRelativeUrl(): void { - // TODO(nayeemrmn): Base from `--location` when implemented and set. - assertThrows(() => new Request("relative-url"), TypeError, "Invalid URL."); + assertEquals( + new Request("relative-url").url, + "http://js-unit-tests/foo/relative-url", + ); }); unitTest(async function cloneRequestBodyStream(): Promise<void> { |
