re: Unit testing is simple VIEW POST

re: This is a good starting point! I'm not an expert on this topic, but unit testing seems easy when you test "pure" functions. What happens when you h...

Great question!

Exactly! If you want to make your life as easy as possible, you'll have as high a percentage of pure functions as possible. This requires explicit effort.

While you can achieve purity in any language, functional programming languages let you achieve it far more easily.

Personally most side-effecting code I write is also externally facing code, which makes them Integration Tests rather than Unit tests.

I very rarely use spies/mocks and the like. Brittle.

Code of Conduct Report abuse