Testing · Middle · Question 13 of 75
What is the difference between mockClear, mockReset and mockRestore?
- ✓Correct answer: Clear removes call history; reset also removes the implementation; restore returns the original for spies
- 2They are aliases
- 3Clear deletes the mock, reset clears history, restore re-runs the test
Explanation
Config options clearMocks, mockReset and restoreMocks apply them automatically before each test.