Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jest mock call

test("mock.calls", () => {
  const mockFn = jest.fn();
  mockFn(1, 2);

  expect(mockFn.mock.calls).toEqual([[1, 2]]);
});
Source by medium.com #
 
PREVIOUS NEXT
Tagged: #jest #mock #call
ADD COMMENT
Topic
Name
8+5 =