title: Unit test with Swift: body of closure not executed
body: <p>There are functions that send a request to server, get response and print result.  They always work in the iOS app itself but only sometimes (looks like randomly) in unit-tests of this app. </p>
  
  <p>Main issue: Xcode doesn't enter the body of a closure in unit-tests, just skips it.</p>
  
  <p>Any ideas how can it be fixed? <a href="https://i.stack.imgur.com/SFGeF.jpg" rel="nofollow noreferrer">Image of the problem in Xcode.</a></p>