I am trying to do manual mock for the custom module ->help.js I have created manual mock |-models | |-mocks |-help.js |help.js |test.js
mocked the functions like help.js
jest.mock('./help', () => {
return {
add: jest.fn(() => jest.fn()),
delete: jest.fn(() => jest.fn()),
toggle: jest.fn(() => jest.fn())
};
and I am trying to using mocking module in test.js like
jest.mock('./_mocks_/help');
const help =require()
test('add',()=>{
expect(help.add).toHaveBeenCalledWith({
type: 'test',
});
})
again it is calling main implementation module instead of mock module. please help me on this.I am new to jest Thanks in advance