Testing · Senior · Question 41 of 75
Why is mocking useState or other React hooks a bad idea?
- ✓Correct answer: It tests React's internals instead of behaviour and breaks on any refactor; drive state through user interactions
- 2It's impossible to mock hooks
- 3It makes tests too slow
Explanation
Mock boundaries (network, time, browser APIs), not the framework.