Testing state logic builds confidence that your state transitions and updates are correct. The strategy depends on how the logic is structured — pure functions (reducers) are easiest to test, so well-architected state is also well-testable state.
Test pure reducers directly (the easiest, highest-value case)
(, {
(, {
initial = [];
next = (initial, { : , : { : , : } });
(next).([{ : , : }]);
(initial).([]);
});
});
