Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jest mock mockname

test("mockName", () => {
  const mockFn = jest.fn().mockName("mockedFunction");
  mockFn(); // comment me
  expect(mockFn).toHaveBeenCalled();
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #jest #mock #mockname
ADD COMMENT
Topic
Name
3+7 =