Monthly archives of “May 2020

comment 0

#54 Stubbing DispatchQueue in unit tests to run tests synchronously

The Dispatching protocol In issue #50 Synchronous Unit Tests I described an approach on how to get rid of waiting for XCTestExpectation to be fulfilled. The approach assumes hiding an asynchronous dispatch of a block/closure of code to a GCD queue behind an abstraction layer called the Dispatching protocol. In the production code you would implement a Dispatcher type like…