Skip to content

Commit

Permalink
update hoisted paths for unit test mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
yousif-bugsnag committed Feb 5, 2024
1 parent 6c0441b commit b799cef
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/expo/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ jest.mock('expo-constants', () => ({
}
}))

jest.mock('../../plugin-expo-device/node_modules/expo-constants', () => ({
jest.mock('../../node_modules/expo-constants', () => ({
default: {
platform: {},
expoConfig: {},
expoGoConfig: null
}
}))

jest.mock('../../plugin-expo-app/node_modules/expo-application', () => ({}))
jest.mock('../../node_modules/expo-application', () => ({}))

jest.mock('../../plugin-expo-app/node_modules/expo-constants', () => ({
jest.mock('../../node_modules/expo-constants', () => ({
default: {
platform: {},
expoConfig: {},
Expand All @@ -31,7 +31,7 @@ jest.mock('../../plugin-expo-app/node_modules/expo-constants', () => ({
}))

jest.mock('@bugsnag/delivery-expo')
jest.mock('../../delivery-expo/node_modules/expo-crypto', () => ({}))
jest.mock('../../node_modules/expo-crypto', () => ({}))

jest.mock('react-native', () => ({
NativeModules: {
Expand Down Expand Up @@ -61,7 +61,7 @@ jest.mock('react-native', () => ({
}
}))

jest.mock('../../delivery-expo/node_modules/expo-file-system', () => ({
jest.mock('../../node_modules/expo-file-system', () => ({
cacheDirectory: 'file://var/data/foo.bar.app/',
downloadAsync: jest.fn(() => Promise.resolve({ md5: 'md5', uri: 'uri' })),
getInfoAsync: jest.fn(() => Promise.resolve({ exists: true, md5: 'md5', uri: 'uri' })),
Expand All @@ -75,17 +75,17 @@ jest.mock('../../delivery-expo/node_modules/expo-file-system', () => ({
createDownloadResumable: jest.fn(() => Promise.resolve())
}))

jest.mock('../../delivery-expo/node_modules/@react-native-community/netinfo', () => ({
jest.mock('../../node_modules/@react-native-community/netinfo', () => ({
addEventListener: jest.fn(),
fetch: () => Promise.resolve({ isConnected: true })
}))

jest.mock('../../plugin-expo-connectivity-breadcrumbs/node_modules/@react-native-community/netinfo', () => ({
jest.mock('../../node_modules/@react-native-community/netinfo', () => ({
addEventListener: jest.fn(),
fetch: () => Promise.resolve({ isConnected: true })
}))

jest.doMock('../../plugin-expo-device/node_modules/expo-device', () => ({
jest.doMock('../../node_modules/expo-device', () => ({
manufacturer: 'Google',
modelName: 'Pixel 4'
}))
Expand Down

0 comments on commit b799cef

Please sign in to comment.