diff options
| author | stonedDiscord <stonedDiscord@users.noreply.github.com> | 2024-11-20 13:31:50 +0000 |
|---|---|---|
| committer | GitHub Action <actions@github.com> | 2024-11-20 13:31:50 +0000 |
| commit | 6684f3fce6e90fd0574d7bab63b629554ab03ef6 (patch) | |
| tree | b2a62247d17e23a77af57aea355ba621666817c2 /webAO/utils/__tests__/tryUrls.test.ts | |
| parent | 95a2d1361d84c61b454ebe506e6963b93f6d8dee (diff) | |
Prettified Code!
Diffstat (limited to 'webAO/utils/__tests__/tryUrls.test.ts')
| -rw-r--r-- | webAO/utils/__tests__/tryUrls.test.ts | 51 |
1 files changed, 24 insertions, 27 deletions
diff --git a/webAO/utils/__tests__/tryUrls.test.ts b/webAO/utils/__tests__/tryUrls.test.ts index ebc2f6b..f85392c 100644 --- a/webAO/utils/__tests__/tryUrls.test.ts +++ b/webAO/utils/__tests__/tryUrls.test.ts @@ -1,31 +1,28 @@ -import fileExists from '../fileExists' -import tryUrls from '../tryUrls'; -import transparentPng from '../../constants/transparentPng' -jest.mock('../fileExists') +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); - }); -}) - +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); + }); +}); |
