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 | |
| parent | c347dfcd565c3a396ae84dff46e7374851913462 (diff) | |
feat: add --location=<href> and globalThis.location (#7369)
Diffstat (limited to 'cli/tests/unit')
| -rw-r--r-- | cli/tests/unit/fetch_test.ts | 11 | ||||
| -rw-r--r-- | cli/tests/unit/request_test.ts | 8 | ||||
| -rwxr-xr-x | cli/tests/unit/unit_test_runner.ts | 1 |
3 files changed, 6 insertions, 14 deletions
diff --git a/cli/tests/unit/fetch_test.ts b/cli/tests/unit/fetch_test.ts index e5389d024..6945b2e2a 100644 --- a/cli/tests/unit/fetch_test.ts +++ b/cli/tests/unit/fetch_test.ts @@ -221,17 +221,6 @@ unitTest({ perms: { net: true } }, async function responseClone(): Promise< } }); -unitTest({ perms: { net: true } }, async function fetchEmptyInvalid(): Promise< - void -> { - await assertThrowsAsync( - async () => { - await fetch(""); - }, - URIError, - ); -}); - unitTest( { perms: { net: true } }, async function fetchMultipartFormDataSuccess(): Promise<void> { 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> { diff --git a/cli/tests/unit/unit_test_runner.ts b/cli/tests/unit/unit_test_runner.ts index 35a691ebd..1f347ec9a 100755 --- a/cli/tests/unit/unit_test_runner.ts +++ b/cli/tests/unit/unit_test_runner.ts @@ -97,6 +97,7 @@ function spawnWorkerRunner( Deno.execPath(), "run", "--unstable", // TODO(ry) be able to test stable vs unstable + "--location=http://js-unit-tests/foo/bar", "-A", "cli/tests/unit/unit_test_runner.ts", "--worker", |
