Use named import from pretty-format, not default#11360
Merged
SimenB merged 2 commits intojestjs:masterfrom Apr 30, 2021
Merged
Conversation
SimenB
reviewed
Apr 30, 2021
| import chalk = require('chalk'); | ||
| import getType = require('jest-get-type'); | ||
| import prettyFormat, {plugins as prettyFormatPlugins} from 'pretty-format'; | ||
| import getType from 'jest-get-type'; |
Member
There was a problem hiding this comment.
rebasing on master should fix this
4f53048 to
e5f10f7
Compare
Contributor
Author
|
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. |
Member
|
Yep, looks like flake to me 👍 |
Contributor
Author
|
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. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Similarly to #11359, I was trying to run
expectin snowpack / webtestrunner, and got errors aboutThis is because
pretty-formatexports 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.