Interview practice question
Test setup is duplicated and hard to maintain
Frontend Engineering · Testing and Tooling · Intermediate
Many tests build large mock objects by hand, and changing a data type means updating hundreds of tests. How would you fix it?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Factory/builder functions with defaults.
- Override only relevant fields.
- Typed factories.
- Shared MSW handlers.
- Libraries like fishery.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.