MakeAWishFoundation / SwiftyMocky

Framework for automatic mock generation. Adds a set of handy methods, simplifying testing. One of the best and most complete solutions, including generics support and much more.
MIT License
1.04k stars 106 forks source link

[Swift 5.5] Mock generation with async funcs not working #290

Closed Smponias closed 3 years ago

Smponias commented 3 years ago

I am testing the new async await feature from Swift 5.5 and SwiftyMocky can't generate mocks for async funcs. I just wanted to let you know.

e. g. func isOnline() async -> Bool

The mock looks like this:

open func isOnline() -> async -> Bool {
...
}
g-amichnia commented 3 years ago

Working on it. I am pretty confident it will be part of 4.1 in few days.

g-amichnia commented 3 years ago

OK, so the generation works, but mocks does not have async modifier, as Sourcery does not provide that yet. Still, the tests should work anyway. Same with throwing variables (but in this case there is no way to specify throw value yet)

Considering it fixed in 4.1, since it does not break tests anymore.