Group Group Group Group Group Group Group Group Group

Question about Testing Asynchronous Code

I just went through the testing tutorial found here.

First off let me say that it was really useful!

I do have a question though. It seems like the Failing Fast section implies that it’s better to use the testCallToiTunesCompletes() test instead of the testValidCallToiTunesGetsHTTPStatusCode200() test. Am I understanding this correctly?

Thanks!

Dan

Also, I’m getting a warning in DHURLSession when I change the deploy target to iOS 13+: “‘init()’ was deprecated in iOS 13.0”. It’s on line 49, dataTaskMock = URLSessionDataTaskMock().

Any thoughts on how to deal with this?

I was able to take care of the unit warning by adding init() { } to URLSessioDataTaskMock.