diff options
| author | stonedDiscord <Tukz@gmx.de> | 2025-09-03 17:37:36 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-03 17:37:36 +0200 |
| commit | 0d2a3994e203755702ebe4afbd0f3c721ee8ce38 (patch) | |
| tree | 9347303eaa9daad5e10420ab1d90e24593c70df1 /webAO/__tests__/tryUrls.test.ts | |
| parent | 8e46e304f4defc7f9f4eb01922812b28a8585307 (diff) | |
| parent | 035951baf3819f56093f7156b345689aa5093f28 (diff) | |
Merge pull request #270 from AttorneyOnline/ext
Let the webhost specify the extensions use
Diffstat (limited to 'webAO/__tests__/tryUrls.test.ts')
| -rw-r--r-- | webAO/__tests__/tryUrls.test.ts | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/webAO/__tests__/tryUrls.test.ts b/webAO/__tests__/tryUrls.test.ts deleted file mode 100644 index 4a32f32..0000000 --- a/webAO/__tests__/tryUrls.test.ts +++ /dev/null @@ -1,28 +0,0 @@ -import fileExists from "../utils/fileExists"; -import tryUrls from "../utils/tryUrls"; -import transparentPng from "../constants/transparentPng"; -jest.mock("../utils/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); - }); -}); |
