Adding error case in test

This commit is contained in:
David Négrier 2021-07-21 18:49:25 +02:00
parent 1435ec89c9
commit ddabda1c4b

View File

@ -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();
});
});