You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
We have a component test library for testing services (which use an uberfx-based library) as a blackbox. For this test framework we would like to catch all errors rather than exit the process.
As a bonus, it would be extra helpful if we had a good mechanism to test the actual error too (prior to os.Exit(1) being called), but understand that's a bigger scope - as long as that error is logged using the FX logger at least we can intercept that.
Describe the solution you'd like
I'd love to have an ability to override the osExit function used, similar to what's supported internally: #792
Describe alternatives you've considered
We've added our own timeouts in our test cases that developers set separately from FX timeouts. This is a recent comment that prompted me opening this ticket when it came up in a PR on our internal component test framework:
cc @CTrando
Is this a breaking change?
No
Additional context
n/a
The text was updated successfully, but these errors were encountered:
sywhang
changed the title
Add ability to override os.Exit
Add ability to override os.Exit for fxtest
Sep 12, 2023
I believe this is a fair ask if we're discussing how we can override it for testing purposes. Retitled the issue to reflect that - we can add this to fxtest package that can be used for configuring a test App.
For more general-purpose configuration of App though, i don't think it makes much sense to override that since there's no way to stop user-provided code from calling os.Exit or override its behavior.
Is your feature request related to a problem? Please describe.
We have a component test library for testing services (which use an uberfx-based library) as a blackbox. For this test framework we would like to catch all errors rather than exit the process.
As a bonus, it would be extra helpful if we had a good mechanism to test the actual error too (prior to
os.Exit(1)
being called), but understand that's a bigger scope - as long as that error is logged using the FX logger at least we can intercept that.Describe the solution you'd like
I'd love to have an ability to override the
osExit
function used, similar to what's supported internally: #792Describe alternatives you've considered
We've added our own timeouts in our test cases that developers set separately from FX timeouts. This is a recent comment that prompted me opening this ticket when it came up in a PR on our internal component test framework:
cc @CTrando
Is this a breaking change?
No
Additional context
n/a
The text was updated successfully, but these errors were encountered: