Avoiding Mutations
Learn ways to avoid mutations while testing reducers.
We'll cover the following...
We'll cover the following...
One key requirement is that our reducers never modify the state but only create a new one. Our current tests do not verify this behavior.
While we can try to catch these mistakes by manually verifying that the initial state did not change, a simpler approach would be to “freeze” the initial state and ...