Skip to content
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

[test] Match against messages not args on console methods #20046

Merged
merged 3 commits into from
Mar 10, 2020

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Mar 9, 2020

react@next leverages the formatting signature of console.error (console.error(message, ...substitutions)) when checking prop-types. This makes consoleErrorMock.args() more brittle.

We want to match against the error message anyway so we switch from args() to messages(). It should return the same output as one would see in the browser (node uses util.format so we use an implementation of util.format that works in the browser).

@eps1lon eps1lon added the test label Mar 9, 2020
@mui-pr-bot
Copy link

mui-pr-bot commented Mar 9, 2020

No bundle size changes comparing d47c518...85689cf

Generated by 🚫 dangerJS against 85689cf

test/utils/consoleErrorMock.js Outdated Show resolved Hide resolved
test/utils/consoleErrorMock.test.js Outdated Show resolved Hide resolved
@eps1lon eps1lon merged commit 026fea2 into mui:master Mar 10, 2020
@eps1lon eps1lon deleted the test/react-next branch March 10, 2020 00:40
EsoterikStare pushed a commit to EsoterikStare/material-ui that referenced this pull request Mar 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants