You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.
I haven't been able to test anything with toHaveStyleRule and jest-styled-components because of some issue with my configuration and/or mismatching versions, but still i thing that file should be totally covered
Here's my configuration in case I'm missing something:
import'react-native-gesture-handler/jestSetup';import'jest-styled-components/native';// doesn't work!importEnzymefrom'enzyme';importAdapterfrom'enzyme-adapter-react-16';const{JSDOM}=require('jsdom');constjsdom=newJSDOM();const{window}=jsdom;functioncopyProps(src,target){constprops=Object.getOwnPropertyNames(src).filter((prop)=>typeoftarget[prop]==='undefined').map((prop)=>Object.getOwnPropertyDescriptor(src,prop));Object.defineProperties(target,props);}global.window=window;global.document=window.document;global.navigator={userAgent: 'node.js',};copyProps(window,global);jest.mock('react-native-reanimated',()=>{constReanimated=require('react-native-reanimated/mock');// The mock for `call` immediately calls the callback which is incorrect// So we override it with a no-opReanimated.default.call=()=>{};returnReanimated;});import{NativeModules}from'react-native';NativeModules.RNGestureHandlerModule={attachGestureHandler: jest.fn(),createGestureHandler: jest.fn(),dropGestureHandler: jest.fn(),updateGestureHandler: jest.fn(),State: {},Directions: {},};NativeModules.ImagePickerManager={showImagePicker: jest.fn(),};NativeModules.Linking={canOpenUrl: jest.fn().mockResolvedValue(true),openUrl: jest.fn().mockResolvedValue(true),};NativeModules.Platform={OS: 'iOS',};jest.mock('react-native/Libraries/Animated/src/NativeAnimatedHelper');jest.mock('react-native/Libraries/Animated/src/animations/TimingAnimation');Enzyme.configure({adapter: newAdapter()});
Any help would be appreciated! Please let me know if I'm wrong and why are there any branches there... Thanks a lot!
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm getting a coverage report with missing coverage for branches that aren't there (I think):
Here's the test:
Another example:
And its test:
I haven't been able to test anything with
toHaveStyleRule
andjest-styled-components
because of some issue with my configuration and/or mismatching versions, but still i thing that file should be totally coveredHere's my configuration in case I'm missing something:
package.json:
babel.config.js:
jest.setup.js:
Any help would be appreciated! Please let me know if I'm wrong and why are there any branches there... Thanks a lot!
The text was updated successfully, but these errors were encountered: