-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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: upgrade to jest 24 #15778
chore: upgrade to jest 24 #15778
Conversation
packages/eslint-plugin-react-hooks/__tests__/ESLintRuleExhaustiveDeps-test.js
Outdated
Show resolved
Hide resolved
packages/eslint-plugin-react-hooks/__tests__/ESLintRulesOfHooks-test.js
Outdated
Show resolved
Hide resolved
packages/react-dom/src/__tests__/ReactDOMServerIntegrationElements-test.js
Outdated
Show resolved
Hide resolved
@@ -160,7 +160,7 @@ describe('ReactTestRendererAsync', () => { | |||
|
|||
expect(() => | |||
expect(Scheduler).toFlushAndYieldThrough(['foo', 'baz']), | |||
).toThrow('Expected value to equal:'); | |||
).toThrow('// deep equality'); |
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.
we've changed the error messages
packages/react/src/__tests__/ReactCoffeeScriptClass-test.coffee
Outdated
Show resolved
Hide resolved
packages/react/src/__tests__/createReactClassIntegration-test.js
Outdated
Show resolved
Hide resolved
@@ -12,12 +12,13 @@ module.exports = { | |||
'.*': require.resolve('./preprocessor.js'), | |||
}, | |||
setupFiles: [require.resolve('./setupEnvironment.js')], | |||
setupTestFrameworkScriptFile: require.resolve('./setupTests.js'), | |||
setupFilesAfterEnv: [require.resolve('./setupTests.js')], |
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.
renamed option
scripts/jest/preprocessor.js
Outdated
@@ -53,6 +53,9 @@ module.exports = { | |||
if (filePath.match(/\.ts$/) && !filePath.match(/\.d\.ts$/)) { | |||
return tsPreprocessor.compile(src, filePath); | |||
} | |||
if (filePath.match(/\.json$/) ) { |
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.
Jest passes json files through transformers now, and babel didn't like it 🙂
LogError: Error: /home/circleci/project/babel.config.js: Error while loading config - .sourceFileName must be a string, or undefined
at assertString (/home/circleci/project/node_modules/@babel/core/lib/config/validation/option-assertions.js:118:11)
at Object.keys.forEach.key (/home/circleci/project/node_modules/@babel/core/lib/config/validation/options.js:107:5)
at Array.forEach (<anonymous>)
at validateNested (/home/circleci/project/node_modules/@babel/core/lib/config/validation/options.js:83:21)
at validate (/home/circleci/project/node_modules/@babel/core/lib/config/validation/options.js:74:10)
at loadPrivatePartialConfig (/home/circleci/project/node_modules/@babel/core/lib/config/partial.js:66:50)
at loadFullConfig (/home/circleci/project/node_modules/@babel/core/lib/config/full.js:43:39)
at transformSync (/home/circleci/project/node_modules/@babel/core/lib/transform.js:41:38)
at Object.transform (/home/circleci/project/node_modules/@babel/core/lib/transform.js:22:38)
at Object.exports.babelify (/home/circleci/project/node_modules/danger/distribution/runner/runners/utils/transpiler.js:71:24)
Generated by 🚫 dangerJS |
Not sure I understand - you mean that |
Correct.
It is semver compatible, but the package has not been built/compiled to cjs so it doesn't work. Its main point to this file: https://github.com/facebook/react/blob/3b2302253f13c9cd049fac10784e10b6c582e3b6/packages/react-is/index.js I'd like to tell yarn to ignore the |
Oh I see, so you want to ignore the local workspace .. hm .. this should be doable with resolutions. Something like this, maybe? {
"resolutions": {
"pretty-format/react-is": "npm:react-is@<insert the semver range>"
}
} |
That sorta works - it does indeed install from the npm registry, but it installs it to |
Damn, that's likely a bug in the I don't see an easy fix then ... maybe a It's interesting we never got this problem before, though! |
Now's a good time for us to land this. What do you folks think is the best option right to resolve this pretty-format/react-is issue? |
I'm not sure :( I didn't try out @arcanis's last suggestion since he said it was hacky. Maybe give that a go? I'm on vacation for a few more days, so if you have time, that'd be great. Otherwise I'll give it a whack some time next week (Landing #15779 in the meantime would be great, to reduce this diff) |
Cool cool, enjoy your vacation! I’ll poke at this myself soon |
8546fc8
to
3fdd00f
Compare
I've rebased this now that the other PR landed, but it still has the same |
🎉 |
2da454f
to
9f731b4
Compare
Rebased and squashed the extra commits to migrate devtools over. So now it's one commit migrating to v24, and the one commit I'm rather hesitant to have my name next to as a separate one for the hacky (I often use this repo to test out breaking changes in Jest itself, especially around fake timers, which is why I wanna see it upgraded. 🙂 Makes it easier) |
@@ -25,7 +25,6 @@ | |||
"archiver": "^3.0.0", | |||
"babel-core": "^7.0.0-bridge", | |||
"babel-eslint": "^9.0.0", | |||
"babel-jest": "^24.7.1", |
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.
these are just remnants after migrating it into this monorepo, I guess? They're unused
@@ -25,7 +25,6 @@ | |||
"archiver": "^3.0.0", | |||
"babel-core": "^7.0.0-bridge", |
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.
this is quite possible also redundant now? not sure... but if it was here for jest@23, then it can go 🙂
@threepointone any news from your meeting? |
@threepointone ping 🙂 |
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.
Alright, I'm biting the bullet and approving this. We need jest 24 badly, and this hack is probably the way forward for now. Thanks @SimenB for your patience and effort! You're the best.
I've approved, but could you rebase one last time and make sure nothing's broken? I don't expect it to be, but want to be certain before I hit merge :) |
Awesome! I'll give it a rebase tonight or tomorrow |
rebased, and CI still seems happy 👍 |
bing bang bosh, it's in! |
woo, thanks! 🎉 |
No, thank you! We can finally start using inline snapshots yay 😃 |
* chore: upgrade to jest 24 * download react-is from npm manually
This was added during an upgrade to Jest 24 in #15778 By now we're at Jest 29. I think if CI passes we might not need this hack anymore.
This was added during an upgrade to Jest 24 in #15778 By now we're at Jest 29. I think if CI passes we might not need this hack anymore.
Summary: This was added during an upgrade to Jest 24 in facebook/react#15778 By now we're at Jest 29. I think if CI passes we might not need this hack anymore. DiffTrain build for commit facebook/react@c57a0f6. Reviewed By: poteto Differential Revision: D45238250 Pulled By: kassens fbshipit-source-id: 1dfb90dc08a2765a6d499a5754a311ecae002314
Summary: This was added during an upgrade to Jest 24 in facebook/react#15778 By now we're at Jest 29. I think if CI passes we might not need this hack anymore. DiffTrain build for commit facebook/react@c57a0f6. Reviewed By: poteto Differential Revision: D45238250 Pulled By: kassens fbshipit-source-id: 1dfb90dc08a2765a6d499a5754a311ecae002314
Summary: This was added during an upgrade to Jest 24 in facebook/react#15778 By now we're at Jest 29. I think if CI passes we might not need this hack anymore. DiffTrain build for commit facebook/react@c57a0f6. Reviewed By: poteto Differential Revision: D45238250 Pulled By: kassens fbshipit-source-id: 1dfb90dc08a2765a6d499a5754a311ecae002314
This was added during an upgrade to Jest 24 in facebook#15778 By now we're at Jest 29. I think if CI passes we might not need this hack anymore.
This won't work on CI since
pretty-format
usesreact-is
internally, and since yarn findsreact-is
in this repo, it won't install it. I don't know how to tell yarn to install a version ofreact-is
intopretty-format
snode_modules
? To test this locally, I just didcp -R ../jest/node_modules/react-is node_modules/pretty-format/node_modules
which worked fine. Maybe @arcanis can help?All tests pass locally 🙂
This contains #15779 with the upgrade to jest 24 applied on top of it