Testing · Junior · Question 31 of 78
What does jest.fn() / vi.fn() create?
- ✓Correct answer: A mock function that records calls and arguments and can return configured values
- 2A real copy of the function under test
- 3A function that fails the test when called
Explanation
Typical use: pass it as a callback prop and check that it was called.