expecta icon indicating copy to clipboard operation
expecta copied to clipboard

Async testing and beInstanceOf

Open aprofromindia opened this issue 10 years ago • 1 comments

Async testing fails with after() fails with the matcher beInstanceOf while equal works, am I missing something - My code here : -

https://github.com/aprofromindia/Airlines-List---Clean-Code/blob/master/Sample%20AppTests/MasterViewControllerSpec.m

aprofromindia avatar Aug 20 '15 19:08 aprofromindia

I just fell into this.

The problem is that when the matcher is applied for the first time, the pre-requisite of beInstanceOf is not fullfilled.

And, in the case of the pre-requisite not being fulfilled, it will fail immediately instead of retrying the test, as can be seen around here

I guess it would make sense to re-evaluate the pre-requisite every time the runloop runs. If it fails, treat it as a matcher fail and run keep running it. Does that make sense?

dbarden avatar May 03 '16 06:05 dbarden