-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
allowConsoleError should capture async errors #15609
Comments
one idea is to make
|
@lannka Thanks for bringing this up. In your suggested fix, what happens if a test that generates (sync or async) console errors simply fails to call expectConsoleError? We don't want the test to just pass (this was the original problem we were trying to fix). What mechanism will cause it to fail? |
We still stub |
Hmm. I want to make sure this doesn't place an undue burden on each test to explicitly declare which errors it expects twice. So a test like this...
... can be written like this today...
... but with the new suggestion, might have to be re-written like this...
I'll dig in to this some more and see if we can get the best of both worlds, where existing usage of |
For a temporary workaround, see what #15606 does |
I ended up implementing more or less what @lannka suggested in #15621. Here is a usage example:
If |
The following code illustrate the problem, where we expect a console error, but it actually might leak to outside of this test.
The text was updated successfully, but these errors were encountered: