December 2018
Intermediate to advanced
642 pages
15h 5m
English
Using npm test will produce a nice all green output, meaning that all of the tests have passed, as in the previous section; no need to see that again. In each individual test, we apply the technique that was described earlier: set up state, save a string version of it, apply the reducer or the mapper function, check it matches what you wanted it to produce, and check that the original state still matches the saved version.
Imagine that somebody accidentally modified the getProps() function that we tested so that instead of returning the regions, it returned the countries list, like so:

Read now
Unlock full access