1. 6
    Adding More Test Cases for a Redux Reducer
    2m 21s

Adding More Test Cases for a Redux Reducer

InstructorJamund Ferguson

Share this video with your friends

Send Tweet

Just because you've run a function through one set of inputs, doesn't mean other inputs will behave the same way. This is often true with state management solutions where it's common to memoize responses & cache data. We only end up with 4 tests total for our products reducer, but I'd like you to consider all of the following cases when you're writing reducer tests for your production applications.

  • Valid Input
  • Valid Input more than once
  • Invalid Input
  • Invalid Input more than once
  • With Existing State
  • With No Existing State
  • Invalid/Unknown Action Type