diff --git a/web/src/lib/utils/app-update.spec.ts b/web/src/lib/utils/app-update.spec.ts index ce901cec8..2398efb8a 100644 --- a/web/src/lib/utils/app-update.spec.ts +++ b/web/src/lib/utils/app-update.spec.ts @@ -5,7 +5,7 @@ describe('web update checking', () => { ['same', false], ['new-build', true], ])('compares the deployed build %s', async (version, available) => { - const request = vi.fn().mockResolvedValue(new Response(JSON.stringify({ version }))); + const request = vi.fn().mockResolvedValue(Response.json({ version })); expect(await checkWebUpdate('same', request)).toEqual({ version, available }); expect(request).toHaveBeenCalledWith( '/_app/version.json', @@ -14,9 +14,7 @@ describe('web update checking', () => { }); it.each([null, {}, { version: '' }, { version: 42 }])('rejects an invalid version response %j', async (body) => { - await expect( - checkWebUpdate('same', vi.fn().mockResolvedValue(new Response(JSON.stringify(body)))), - ).rejects.toThrow(); + await expect(checkWebUpdate('same', vi.fn().mockResolvedValue(Response.json(body)))).rejects.toThrow(); }); it('reports HTTP errors instead of treating them as no updates', async () => {