From 677e0cb8d2be832c14d1ecba3b19ffda77936481 Mon Sep 17 00:00:00 2001 From: Ethan Davidson <31261035+EthanThatOneKid@users.noreply.github.com> Date: Tue, 17 Sep 2024 14:13:17 -0700 Subject: [PATCH] add test, go resolves subdomain destination --- go_test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/go_test.ts b/go_test.ts index 1b201f1..59ad379 100644 --- a/go_test.ts +++ b/go_test.ts @@ -96,3 +96,10 @@ Deno.test("go returns passed URL if invalid or not found", () => { assertEquals(go(input, {}), input, `failed on ${input}`); }); }); + +Deno.test("go resolves subdomain destination", () => { + const expected = new URL("https://foobar.example.com/example"); + const input = new URL("https://example.com/foo/bar"); + const actual = go(input, { "foo/bar": "https://foobar.example.com/example" }); + assertEquals(actual.href, expected.href); +});