diff options
| author | Osmium Sorcerer <os@sof.beauty> | 2026-04-06 14:48:43 +0000 |
|---|---|---|
| committer | Osmium Sorcerer <os@sof.beauty> | 2026-04-18 16:52:23 +0000 |
| commit | 085204dbdf17f379c9a32ea11660accb51b4311d (patch) | |
| tree | dd85139d396f894e69cb66f94859b6d21731f311 /webAO/__tests__ | |
| parent | 45b706909323ba82035c49eb9d2b2546eeab6a78 (diff) | |
Update dependencies and ECMAScript target
Fix relevant breaking changes.
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 +}); |
