about summary refs log tree commit diff
path: root/__tests__/lib
diff options
context:
space:
mode:
Diffstat (limited to '__tests__/lib')
-rw-r--r--__tests__/lib/images.test.ts18
1 files changed, 7 insertions, 11 deletions
diff --git a/__tests__/lib/images.test.ts b/__tests__/lib/images.test.ts
index 461bd04cc..d53a5bc05 100644
--- a/__tests__/lib/images.test.ts
+++ b/__tests__/lib/images.test.ts
@@ -2,31 +2,27 @@ import {downloadAndResize, DownloadAndResizeOpts} from '../../src/lib/images'
 import ImageResizer from '@bam.tech/react-native-image-resizer'
 import RNFetchBlob from 'rn-fetch-blob'
 
-jest.mock('rn-fetch-blob', () => ({
-  config: jest.fn().mockReturnThis(),
-  cancel: jest.fn(),
-  fetch: jest.fn(),
-}))
-jest.mock('@bam.tech/react-native-image-resizer', () => ({
-  createResizedImage: jest.fn(),
-}))
-
 describe('downloadAndResize', () => {
   const errorSpy = jest.spyOn(global.console, 'error')
 
   const mockResizedImage = {
     path: jest.fn().mockReturnValue('file://resized-image.jpg'),
     size: 100,
+    width: 50,
+    height: 50,
+    mime: 'image/jpeg',
   }
 
   beforeEach(() => {
-    jest.clearAllMocks()
-
     const mockedCreateResizedImage =
       ImageResizer.createResizedImage as jest.Mock
     mockedCreateResizedImage.mockResolvedValue(mockResizedImage)
   })
 
+  afterEach(() => {
+    jest.clearAllMocks()
+  })
+
   it('should return resized image for valid URI and options', async () => {
     const mockedFetch = RNFetchBlob.fetch as jest.Mock
     mockedFetch.mockResolvedValueOnce({