Open BozhidarKabzamalov opened 1 month ago
I've gotten it to work successfully mocking it this way:
jest.mock('reactotron-react-native', () => {
return {
configure: jest.fn().mockReturnThis(),
setAsyncStorageHandler: jest.fn().mockReturnThis(),
useReactNative: jest.fn().mockReturnThis(),
use: jest.fn().mockReturnThis(),
connect: jest.fn().mockReturnThis(),
onCustomCommand: jest.fn(),
}
})
jest.mock('reactotron-redux', () => {
return {
reactotronRedux: jest.fn(),
}
})
Describe the bug
I have a React Native project and was able to setup
reactotron-react-native
and my tests were still working fine, but as soon as I installedreactotron-redux
and set it up as per documentation, all my tests started failing with the following error -SyntaxError: Cannot use import statement outside a module.
If I remove
.use(reactotronRedux())
fromReactotronConfig.js
the tests start passing again. There doesn't seem to be any documentation regarding mocking so I've found my mock from other Reactotron github issues, but none of them are working for me.I am on the latest verions of both
reactotron-react-native
andreactotron-redux
The error looks like this:
ReactotronConfig.js
Store.js
mocks/reactotron-react-native.js
Reactotron version
5.1.8