aboutsummaryrefslogtreecommitdiff
path: root/webAO/utils/__tests__/tryUrls.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'webAO/utils/__tests__/tryUrls.test.ts')
-rw-r--r--webAO/utils/__tests__/tryUrls.test.ts28
1 files changed, 0 insertions, 28 deletions
diff --git a/webAO/utils/__tests__/tryUrls.test.ts b/webAO/utils/__tests__/tryUrls.test.ts
deleted file mode 100644
index f85392c..0000000
--- a/webAO/utils/__tests__/tryUrls.test.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-import fileExists from "../fileExists";
-import tryUrls from "../tryUrls";
-import transparentPng from "../../constants/transparentPng";
-jest.mock("../fileExists");
-
-const mockFileExists = fileExists as jest.MockedFunction<typeof fileExists>;
-
-describe("tryUrls", () => {
- it("Should try multiple file extensions", async () => {
- const url = "localhost/stoneddiscord/assets";
- mockFileExists
- .mockReturnValueOnce(Promise.resolve(false))
- .mockReturnValueOnce(Promise.resolve(false))
- .mockReturnValueOnce(Promise.resolve(false))
- .mockReturnValueOnce(Promise.resolve(true));
- const actual = await tryUrls(url);
- const expected = "localhost/stoneddiscord/assets.apng";
- expect(actual).toBe(expected);
- });
-
- it("Should return a transparent png if it cant find any assets", async () => {
- const url = "localhost/stoneddiscord/assets";
- mockFileExists.mockReturnValue(Promise.resolve(false));
- const actual = await tryUrls(url);
- const expected = transparentPng;
- expect(actual).toBe(expected);
- });
-});