jest called times

Solutions on MaxInterview for jest called times by the best coders in the world

showing results for - "jest called times"
Sebastián
01 Apr 2017
1const mockCallback = jest.fn(x => 42 + x);
2forEach([0, 1], mockCallback);
3
4// The mock function is called twice
5expect(mockCallback.mock.calls.length).toBe(2);
6