I have one file called helper.js that consist of two functions
export const funcA = (key) => {
return funcB(key)
};
export const func
Late answer but this should work. Also you should test funcB in its own file and not inside the 'helper' tests.
import { funcB } from './funcB';
import { funcA } from './helper';
jest.mock('./funcB');
describe('helper', () => {
test('test funcA', () => {
const funcBSpy = jest.fn();
funcB.mockImplementation(() => funcBSpy());
expect(funcBSpy).toHaveBeenCalledTimes(1);
});
});