After testing the components, we are now moving on to a simpler set of tests: first, reducers; and then mappings such as mapStateToProps() and mapDispatchToProps(). Why are these tests easier to write? Because in all of these cases, we are dealing with pure functions, without side effects, that produce their output based only on their inputs. We already dealt with these sort of functions earlier in this book when we did testing for Node, so now we'll make do with a short section. The only particular care we'll have is to verify that no function (for example, a reducer) attempts to modify the state, but other than that, it's simple to test all the way. In this recipe, let's look at the different kind of tests we'll need for reducers and mappings.
United States
Great Britain
India
Germany
France
Canada
Russia
Spain
Brazil
Australia
Singapore
Hungary
Ukraine
Luxembourg
Estonia
Lithuania
South Korea
Turkey
Switzerland
Colombia
Taiwan
Chile
Norway
Ecuador
Indonesia
New Zealand
Cyprus
Denmark
Finland
Poland
Malta
Czechia
Austria
Sweden
Italy
Egypt
Belgium
Portugal
Slovenia
Ireland
Romania
Greece
Argentina
Netherlands
Bulgaria
Latvia
South Africa
Malaysia
Japan
Slovakia
Philippines
Mexico
Thailand