-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Use named import from pretty-format, not default #11360
Conversation
packages/jest-diff/src/index.ts
Outdated
@@ -6,8 +6,11 @@ | |||
*/ | |||
|
|||
import chalk = require('chalk'); | |||
import getType = require('jest-get-type'); | |||
import prettyFormat, {plugins as prettyFormatPlugins} from 'pretty-format'; | |||
import getType from 'jest-get-type'; |
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.
rebasing on master should fix this
4f53048
to
e5f10f7
Compare
Hmmm, I rebased and I don't understand why one of the tests failed. Maybe it's a flakey test? I also don't think I can restart it. |
Yep, looks like flake to me 👍 |
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.
👍
Thanks for the speedy reviews and merges! 🎉 |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Similarly to #11359, I was trying to run
expect
in snowpack / webtestrunner, and got errors aboutThis is because
pretty-format
exports both a default export and named exports. This confuses babel+rollup, but it sounded like it was an intentional decision in #10515 to keep both. So, this PR does not remove the default export, but it changes all of the existing default imports throughout jest into named imports instead. This seems to compile to cjs in such a way that rollup can successfully turn it back into esm.Test plan
Same as in #11359, I built jest and used it in my app, and the errors were resolved.