Error:
The "actual" argument in expect(actual).toHaveBeenCalled() must be a spy
Minimal not-working example:
const mockFn = jest.fn();
mockFn();
expect(mockFn).toHaveBeenCalled();
Question: is jest.fn()
not a spy?
Error:
The "actual" argument in expect(actual).toHaveBeenCalled() must be a spy
Minimal not-working example:
const mockFn = jest.fn();
mockFn();
expect(mockFn).toHaveBeenCalled();
Question: is jest.fn()
not a spy?
I tried the below implementation which worked for me,