News for hackers. Stuff that matters.
Re:Questions to ask yourself when writing tests by reledi on Tuesday January 02, 2018 @08:30AM (#16051714)
I run into the same problem with React and it bugs me from a testing standpoint.

Extracting code from a big component to helper functions and extracting those functions from the component can lead to cleaner code, and it makes it much easier to test the behaviour of the helpers directly than having to render the component with enzyme.

A good example of this is moving state changes to pure functions [1] which makes them much easier to test, but you'll need to export those functions to test them.

1: https://twitter.com/dan_abramov/status/824310320399319040

Re:Questions to ask yourself when writing tests by nexfitter on Tuesday January 02, 2018 @10:30AM (#16052360)
that is a really cool technique, thanks for the link!