diff options
Diffstat (limited to 'webAO/__tests__')
| -rw-r--r-- | webAO/__tests__/downloadFile.test.ts | 6 | ||||
| -rw-r--r-- | webAO/__tests__/isAudio.test.ts | 3 |
2 files changed, 4 insertions, 5 deletions
diff --git a/webAO/__tests__/downloadFile.test.ts b/webAO/__tests__/downloadFile.test.ts index 738d6f3..67c2c46 100644 --- a/webAO/__tests__/downloadFile.test.ts +++ b/webAO/__tests__/downloadFile.test.ts @@ -2,7 +2,7 @@ import downloadFile from "../services/downloadFile"; jest.useFakeTimers().setSystemTime(new Date("2020-01-01").getTime()); global.URL.createObjectURL = jest.fn(); -(window as any).global.Blob = function (content, options) { +(window as any).global.Blob = function (content: any, options: any) { return { content, options }; }; @@ -10,7 +10,7 @@ describe("downloadFile", () => { it("Creates an <a> tag", () => { const createElementSpy = jest.spyOn(document, "createElement"); downloadFile("hi", "filename"); - expect(createElementSpy).toBeCalled(); + expect(createElementSpy).toHaveBeenCalled(); }); it("Creates the blob with the correct data", () => { const data = "writingtestsishard"; @@ -22,6 +22,6 @@ describe("downloadFile", () => { type: "text", }, }; - expect(global.URL.createObjectURL).toBeCalledWith(expected); + expect(global.URL.createObjectURL).toHaveBeenCalledWith(expected); }); }); diff --git a/webAO/__tests__/isAudio.test.ts b/webAO/__tests__/isAudio.test.ts index 327a0de..f5b84ef 100644 --- a/webAO/__tests__/isAudio.test.ts +++ b/webAO/__tests__/isAudio.test.ts @@ -19,11 +19,10 @@ describe('isAudio', () => { expect(isAudio('')).toBe(false); // Empty string expect(isAudio(undefined)).toBe(false); // Undefined input expect(isAudio(null)).toBe(false); // Null input - expect(isAudio({})).toBe(false); // Invalid type (object) }); test('should return true for files with multiple valid extensions', () => { expect(isAudio('file.wav.mp3')).toBe(true); expect(isAudio('track.ogg.opus')).toBe(true); }); -});
\ No newline at end of file +}); |
