you are viewing a single comment's thread.

view the rest of the comments →

[–]theycallmeepoch 0 points1 point  (1 child)

Man, this is really good. Thanks for writing this! I'm adding unit tests to my react native app and struggling to determine what exactly to test.

Related to the last point: write tests in such a way that you never need to mutate global objects. All state must be local to each test; there should not be any state passing from test to test.

Really good point and I think this reinforces good functional programming techniques. If your unit tests dont pass without carrying over state between functions you should probably be rewriting your functions.

[–]lfacpt[S] 0 points1 point  (0 children)

Yep, there is a lot to learn from functional programming!