-
Notifications
You must be signed in to change notification settings - Fork 83
Description
The library automatically causes tests to fail when reportIssue
is called, which is not always desirable behaviour and there is no easy way to stop this from happening.
I'm in the process of migrating our custom error handling code over to using swift-issue-reporting. Our app uses TCA. I already have a number of tests where I'm explicitly configuring a dependency to throw an error to test the error handling path - even if we have explicit error handling logic we might still use reportIssue
to log that issue (to Sentry, using a custom reporter). There is no need for this to trigger a test failure.
I expected that this behaviour was just a custom "test" reporter but it isn't, it is hardcoded into reportIssue
. I cannot use withExpectedIssue
because the async version does not support XCTest - I cannot change over to Swift testing just to work around this issue. I can use XCTExpectFailure()
directly but this is a very broad solution that could hide genuine test failures.
I think this behaviour should be configurable, or refactored into a default issue reporter that can be overridden using the existing API for configuring reporters.