Open valeriyvan opened 6 months ago
The problem is the use of XCTWaiter.wait inside of verifySnapshot. Using the synchronous wait function in an asynchronous context is a known issue (that's why Apple introduced await fulfillment(of:)
.
Is this crash Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Current context must not be nil'
? If so, I am hitting that issue too in an async test :/ is there any workaround that we can use until the library can be updated to support some sort of await assertSnapshot
method?
Actually, I did find that marking all the async
tests as @MainActor
works, so there's that... still frustrating but I suppose it works now :/
Please look below example of async test. Test with
XCTAssertEqual
works as expected but same test withassertSnapshot
crashes.What's the way to use
assertSnapshot
in async test?