-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
fix: work around broken console methods #3085
Conversation
context/karma.js
Outdated
return Function.prototype.apply.call(orig, localConsole, arguments) | ||
} catch (error) { | ||
// Sometimes native console methods are broken, but this shouldn't break tests. | ||
// It is especially undesirable in environments like Sauce Labs with limited access to the browser settings. |
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.
Please remove the three lines of comment. The info in the commit message is adequate.
context/karma.js
Outdated
// Sometimes native console methods are broken, but this shouldn't break tests. | ||
// It is especially undesirable in environments like Sauce Labs with limited access to the browser settings. | ||
// See https://stackoverflow.com/questions/46913856/value-is-not-a-sequence-safari-exception | ||
self.log('warn', ['Native method console.' + method + ' is broken:', error]) |
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.
Please use string literal but without attributing the throw to a cause:
`Console method ${method} threw: ${error}`
This issue can also arise if users overwrite console
: it may not be a native method problem.
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.
Turns out we can't use ES2015 there. If we do, it doesn't work in Phantom and other old browsers.
@johnjbarton Not sure what happened to Travis, but looks unrelated to this PR. Please have a look, |
The error is |
Let's see if #3087 helps here. |
Please sync to master and rebase. I think the longer timeout will allow CI to pass. |
closing and opening to trigger travis |
Sometimes console methods are broken, but this shouldn't break tests. See angular/angular.js#16644 (comment)
@johnjbarton Travis is green finally. It was failing because I tried to use ES2015 (template literals) in |
Sometimes native console methods are broken, but this shouldn't break tests.
It is especially undesirable in environments like Sauce Labs with limited access to the browser settings.
See angular/angular.js#16644 (comment)