Skip to content

Commit 1055e36

Browse files
author
German Castro
committed
Fix download test on Node 22
1 parent d42fe78 commit 1055e36

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎src/components/GenerationPanel.test.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ describe('GenerationPanel', () => {
7474

7575
it('downloads cross-origin images through a local blob URL', async () => {
7676
const imageBlob = new Blob(['image'], { type: 'image/png' })
77-
const fetchMock = vi.spyOn(globalThis, 'fetch').mockResolvedValue(new Response(imageBlob))
77+
const fetchMock = vi
78+
.spyOn(globalThis, 'fetch')
79+
.mockResolvedValue({ ok: true, blob: async () => imageBlob } as Response)
7880
const createObjectUrl = vi.spyOn(URL, 'createObjectURL').mockReturnValue('blob:local-image')
7981
const revokeObjectUrl = vi.spyOn(URL, 'revokeObjectURL').mockImplementation(() => undefined)
8082
const click = vi.spyOn(HTMLAnchorElement.prototype, 'click').mockImplementation(() => undefined)

0 commit comments

Comments
 (0)