We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Constantly recieve warnings when trying to verify a call that can throw: warning: no calls to throwing functions occur within 'try' expression
warning: no calls to throwing functions occur within 'try' expression
Protocol as such:
public protocol Fetchable { func fetch(data: Dictionary<String, Any>) throws -> Task<[String: Any], Error> }
Mocked as such:
let JsonFetcher = mock(Fetchable.self)
Tested:
given(try! JsonFetcher.fetch(data: any())).willReturn(Task {[:]}) _ = try! JsonFetcher.fetch(data: [:]) verify(try JsonFetcher.fetch(data: any())).wasCalled()
For both (given & verify) lines in the test, warnings are generated:
warning: no calls to throwing functions occur within 'try' expression given(try! JsonFetcher.fetch(data: any())).willReturn(Task {
and
warning: no calls to throwing functions occur within 'try' expression verify(try JsonFetcher.fetch(data: any())).wasCalled()
No warnings
mockingbird version
Using Mockingbird v0.20.0 0.20.0
swift --version
swift-driver version: 1.62.8 Apple Swift version 5.7 (swiftlang-5.7.0.127.4 clang-1400.0.29.50) Target: x86_64-apple-macosx12.0
SPM package
Both XCTest and Quick/Nimble exhibit the issue.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
New Issue Checklist
Overview
Constantly recieve warnings when trying to verify a call that can throw:
warning: no calls to throwing functions occur within 'try' expression
Example
Protocol as such:
Mocked as such:
Tested:
For both (given & verify) lines in the test, warnings are generated:
and
Expected Behavior
No warnings
Environment
mockingbird version
)swift --version
)SPM package
Both XCTest and Quick/Nimble exhibit the issue.
The text was updated successfully, but these errors were encountered: