migrate to expo-file-system

This commit is contained in:
Hailey
2024-04-06 14:32:35 -07:00
parent a6babaceaf
commit 243a5bebb7
8 changed files with 325 additions and 167 deletions
+13 -8
View File
@@ -1,10 +1,10 @@
/* global jest */
import {configure} from '@testing-library/react-native'
import 'react-native-gesture-handler/jestSetup'
// IMPORTANT: this is what's used in the native runtime
import 'react-native-url-polyfill/auto'
import {configure} from '@testing-library/react-native'
configure({asyncUtilTimeout: 20000})
jest.mock('@react-native-async-storage/async-storage', () =>
@@ -36,14 +36,19 @@ jest.mock('react-native-safe-area-context', () => {
}
})
jest.mock('rn-fetch-blob', () => ({
config: jest.fn().mockReturnThis(),
cancel: jest.fn(),
fetch: jest.fn(),
jest.mock('expo-file-system', () => ({
createDownloadResumable: jest.fn(),
deleteAsync: jest.fn(),
getInfoAsync: jest.fn().mockResolvedValue({
size: 100,
}),
}))
jest.mock('@bam.tech/react-native-image-resizer', () => ({
createResizedImage: jest.fn(),
jest.mock('expo-image-manipulator', () => ({
manipulateAsync: jest.fn().mockResolvedValue({
uri: 'file://resized-image',
}),
SaveFormat: jest.requireActual('expo-image-manipulator').SaveFormat,
}))
jest.mock('@segment/analytics-react-native', () => ({