When got an error below.
Test suite failed to run
Invariant Violation: react-native-cookies: Add RNCookieManagerIOS.h and RNCookieManagerIOS.m to your Xcode project
1 | import { Alert, AsyncStorage, FlatList, Platform, StyleSheet, Text, View } from 'react-native'
> 2 | import CookieManager from 'react-native-cookies'
| ^
Add setup.js anywhere on project root directory or somewhere.
jest.mock('react-native-cookies', () => {
return {
addEventListener: jest.fn(),
removeEventListener: jest.fn(),
openURL: jest.fn(),
canOpenURL: jest.fn(),
getInitialURL: jest.fn(),
}
})
Modify package.json.
"jest": {
"preset": "react-native",
"moduleDirectories": [
"node_modules",
"src",
"test"
],
"setupFiles": [
"<rootDir>/setup.js"
]
}
Top comments (0)