State Management · Senior · Question 49 of 75

Which approach makes state logic easiest to unit-test regardless of the library?

Explanation

A reducer or a store action can be tested by calling it with an input and asserting the output. Components are then tested for behavior (React Testing Library), with server calls mocked at the network layer (e.g. MSW).

Further reading

Problem with a question

State Management · Senior · question 49

Test yourself

Take the State Management · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz