We have seen how pure functions are conceptually better than impure ones, but we cannot set out on a crusade to vanquish all impurity from our code. First, no one can deny that side effects can be useful, or at least unavoidable: you will need to interact with the DOM or call a web service, and there are no ways to do this in a pure way. So, rather than bemoaning the fact that you have to allow for impurity, try to structure your code so that you can isolate the impure functions and let the rest of your code be the best it can possibly be.
With this in mind, you'll have to be able to write unit tests for all kinds of functions, pure or impure. Writing unit tests for functions is different, in terms of both their difficulty and complexity than dealing with pure or impure functions. While coding tests for the former is usually quite...