Testing error code paths in Swift
When writing automated tests, many of us have a tendency to focus on verifying that our code behaves correctly under ideal conditions, but we should really also test how our code behaves when something goes wrong. This week, let’s take a look at how unit tests can be used to verify the correctness of our code’s various failure states.