From ddabda1c4baf8b97a7afd20fedc5bb393195fa71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Wed, 21 Jul 2021 18:49:25 +0200 Subject: [PATCH] Adding error case in test --- back/tests/MapFetcherTest.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/back/tests/MapFetcherTest.ts b/back/tests/MapFetcherTest.ts index 3b47e73b..1e7ca447 100644 --- a/back/tests/MapFetcherTest.ts +++ b/back/tests/MapFetcherTest.ts @@ -23,4 +23,10 @@ describe("MapFetcher", () => { it("should return false on an DNS resolving to a global domain", async () => { expect(await mapFetcher.isLocalUrl("https://maps.workadventu.re")).toBeFalse(); }); + + it("should throw error on invalid domain", async () => { + await expectAsync( + mapFetcher.isLocalUrl("https://this.domain.name.doesnotexistfoobgjkgfdjkgldf.com") + ).toBeRejected(); + }); });