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 stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #jest #mock #call
ADD COMMENT
Topic
Name
7+5 =