So I am trying to add unit tests to my FUNCTIONAL components.
I am using react-redux + redux-saga in my application.
Component That I want to test:
This is the test that I have it right now
const store = mockStore(state);
wrapper = mount(
<Provider store={ store }>
<ItemTab />
</Provider>
);
In my component ItemTab.js I have this function
function test() {
console.log('testing')
}
And in my ItemTab.test.js I am calling this test
describe('ItemTab', () => {
it('first test', () => {
wrapper.test()
});
})
And If I do that I have this error wrapper.test is not a function
Notes:
wrapper.instance() is always giving me nullSo my questions are: