我正在尝试在排毒e2e测试期间模拟模块:
beforeEach(async () => {
function mockFunctions() {
const original = require.requireActual('react-native-device-info');
return {
...original,
getDeviceCountry: jest.fn(() => {
return 'DE'
})
}
}
await jest.mock('react-native-device-info', () => mockFunctions)
})
它不起作用,所以我想知道是否有可能?