✅ Unskip tests that were skipped due to console errors#14549
Merged
rsimha merged 4 commits intoampproject:masterfrom Apr 12, 2018
rsimha:2018-04-11-UnskipTests
Merged
✅ Unskip tests that were skipped due to console errors#14549rsimha merged 4 commits intoampproject:masterfrom rsimha:2018-04-11-UnskipTests
rsimha merged 4 commits intoampproject:masterfrom
rsimha:2018-04-11-UnskipTests
Conversation
Contributor
Author
dreamofabear
approved these changes
Apr 11, 2018
| ' ⤷ If this is expected, use the following pattern to wrap the ' + | ||
| 'test code that generated the error:\n' + | ||
| ' \'allowConsoleError(() => { <code that generated the ' + | ||
| 'error> });'; |
There was a problem hiding this comment.
Should we be encouraging use of allowConsoleError() or giving access to the stub and overriding its behavior?
Contributor
Author
There was a problem hiding this comment.
The plan is for tests to use allowConsoleError. Once all usage of console.error is fixed (or wrapped in allowConsoleError), we can internally make the check more stringent using a mock and start failing tests that have errors. This won't need any changes on the test side.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR unskips all the tests that were skipped earlier due to
console.error. Tests will now have to use anallowConsoleErrorblock around code that legitimately needs to generate an error. Until then, they will continue to pass, but will print a message with theconsole.errortext, and instructions for how to fix it.In addition, this test temporarily reverts to using
sinon.stubforconsole.erroruntil such time that we're ready to fail tests that contain unexpected errors. This will make testing less prone to failures until everyone fixes the errors in their tests.Follow up to #14336
Follow up to #14432
Related to #14406
Related to #7381