New issue
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
Test failures swallowed in addListener callback #20
Comments
Hum onError could default to Zone.current.handleUncaughtError |
notifier.onError = Zone.current.handleUncaughtError; does indeed work. Thank you Remi for the speedy response and the black magic! |
I'll make a pr that makes it the default |
@rrousselGit would it be possible to just |
What do you mean by pain? |
There was an exception thrown inside a listener and there was no way to trace back to the line that caused it. Debugger jumped to the Using |
Why not throw the error directly? try {
listenerEntry.listener(value);
} catch (error, stackTrace) {
if (onError != null) {
onError(error, stackTrace);
} else {
throw error;
}
} |
It notifies all listeners first. |
I am testing stuff inside of the
addListener
callback, but since errors are caught and "redirected" toonError
, test failures are never exposed:Any of those
expect
s failing, and the test will still pass.I tried different ways of overriding the callback but none report back the failure:
So my first workaround is checking on the counter at the end of the test:
Any better ideas or workarounds?
The text was updated successfully, but these errors were encountered: