-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
chore(project): add setup for test failure with unexpected console #5184
chore(project): add setup for test failure with unexpected console #5184
Conversation
…chore/add-warning-for-console-in-test
…chore/add-warning-for-console-in-test
Deploy preview for the-carbon-components ready! Built with commit 29cac6b https://deploy-preview-5184--the-carbon-components.netlify.com |
Deploy preview for carbon-elements ready! Built with commit 29cac6b |
Deploy preview for carbon-components-react ready! Built with commit 29cac6b https://deploy-preview-5184--carbon-components-react.netlify.com |
Dependant on: #5183 |
@@ -22,7 +22,7 @@ const files = glob.sync('**/*.scss', { | |||
const render = promisify(sass.render); | |||
|
|||
describe('styles', () => { | |||
jest.setTimeout(8000); | |||
jest.setTimeout(10000); |
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.
FWIW I had to change this to 12000
to not get an 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.
Ooof, same. Let me bump up to 20000 just in case
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.
LGTM! 👍 ✅
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.
LGTM basically, just wondered if utilizing PR# 4045 in https://github.com/facebook/jest is desirable.
@asudoh yeah! |
Just in case it wasn't clear enough - I meant auto-restoring mocks (e.g. upon global after-each). |
This PR adds some config to our Jest environment to fail tests that emit
console.{error,warn}
while executing. In CI, this setup will also fail tests that emitconsole.log
. This is useful for cleaning up our test output, in addition to pointing to inconsistencies in our tests where props may be incorrectly applied.In order to get the tests to go green, I also needed to update tests that failed these new checks. These tests more often than not were missing props, or adding props to DOM nodes that were meant for specific child components.
Changelog
New
consle.{error,warn,log}
statements (log
is only in CI so that developers can debug locally)Changed
console.*
checksRemoved