expect { sut.getText() }.to(throwAssertion())
expect { try sut.getText() }.to(throwAssertion())
I expected it to test if the fatal error was thrown from my method getText() { fatalError("Mistake.") }
fatalError("The throwAssertion Nimble matcher can only run on x86_64 platforms with " +
"Objective-C (e.g. macOS, iPhone 5s or later simulators). You can silence this error " +
"by placing the test case inside an #if arch(x86_64) or canImport(Darwin) conditional statement")
Could be an issue with using the M1?
List the software versions you're using:
Xcode Default.)Please also mention which package manager you used and its version. Delete the
other package managers in this list:
pod --version in Terminal)carthage version in Terminal)swift build --version in Terminal)Please link to a project we can download that reproduces the issue. Feel free
to delete this section if it's not relevant to the issue (eg - feature request).
The project should be short, self-contained, and correct example.
Yep it's definitely an issue with the M1
Is there any solution for this?
Problem lies in the ThrowAssertion matcher which btw also catches assertions, not only fatalError.
If I remove the platform check arch(x86_64) and edit the scheme to _not_ debug executable during tests, it works for me. The latter is sadly required as Xcode's debugger catches the assertions anyway.
Verified to work on M1 with Xcode 12.4 on arm64 Simulator.
I'd suggest to rename this issue to "Apple Silicon / M1 Support" or something like that. Beside ThrowAssertion requiring an update to #if canImport(Darwin) && (arch(x86_64) || arch(arm64)) the Cwl Library is not arm64 compatible.
See the open issue in the other repo: https://github.com/mattgallagher/CwlPreconditionTesting/issues/21
Most helpful comment
Yep it's definitely an issue with the M1