Learning to test React Native with Jest — part 1
Jason Gaare
72012

Hi Jason, I´m using the enzyme-adapter-react-16 but I get the following error:

TypeError: _reactNative.TouchableNativeFeedback.Ripple is not a function

my test looks like:

it(‘renders as expected’, () => {

const AppNavigator = StackNavigator({

Login: {

screen: Login

}

});

const initialState = {

login: {

payload: { type: ‘NONE’ }

}

};

initialState.payload = { type: ‘SUCCESS’ }

const store = mockStore(initialState)

const actions = store.getActions()

const wrapper = shallow(

<Login navigation={{ navigate: () => {}, goBack: () => {} }} /> ,

{

context: {

store: mockStore(initialState) ,

}

}

);

expect(wrapper.dive()).toMatchSnapshot();

});

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.