diff --git a/utilities/BlobToBase64.test.ts b/utilities/BlobToBase64.test.ts index eea1a45019..fd4cce2709 100644 --- a/utilities/BlobToBase64.test.ts +++ b/utilities/BlobToBase64.test.ts @@ -19,7 +19,8 @@ describe('convert blob to base 64 successfully', () => { }) describe('convert blob to base 64 failing', () => { - test('file is jpeg', async () => { + const original = global.FileReader + beforeAll(() => { Object.defineProperty(global, 'FileReader', { writable: true, value: jest.fn().mockImplementation(() => ({ @@ -29,6 +30,14 @@ describe('convert blob to base 64 failing', () => { onload: jest.fn(), })), }) + }) + afterAll(() => { + Object.defineProperty(global, 'FileReader', { + writable: true, + value: original, + }) + }) + test('file is jpeg', async () => { const jpegBlob = new Blob(['testing'], { type: 'image/jpeg' }) try {