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
Console error info #16897
Console error info #16897
Conversation
This passed on my first test run (I was kind of hoping it would fail to validate that the logging is useful). I think there may be value in merging this though, so that we have more logging for the next time someone hits this. In the meantime, I'm going to rerun and see if I can get a failure. |
Awesome! I'm having a very hard time tracking down some errors in the React upgrade right now (I think they're from dependencies) and this will be super helpful. |
sinon.stub(console, 'error').callsFake(msg => { | ||
const prefix = throwingOnErrors ? '' : '[ignoring]'; | ||
console.error.wrappedMethod(prefix, msg); | ||
if (throwingOnErrors) { | ||
logStack(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason we're printing the stack right away, instead of storing the it and printing it with the stored error after the test? In fact, why not attach the stack to our firstError
object?
Just suggestions, this is clearly an improvement without it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, probably not any good reason. I'll try moving it.
} | ||
|
||
// TODO: temporary logging | ||
console.log('is ErrorEvent: ', msg instanceof ErrorEvent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i should get rid of this
This attempts to add some better login for when we hit console errors.
(1) It includes the name of the test where the error is thrown, for example if I have
I get
(2) It prints a stack trace from the error location:
This won't fix the intermittent errors we've been seeing, but will hopefully make tracking them down easier.