-
-
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
fix: Error Cannot read property converageData of null #7758 #8168
fix: Error Cannot read property converageData of null #7758 #8168
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
We have the same issue described in #7758 in our current application setup, with the following dependencies:
Changes in this PR fix the issue. In addition I have added a couple more tests, and everything looks good from our side. Let me know what do you think. Thank you! |
Codecov Report
@@ Coverage Diff @@
## master #8168 +/- ##
==========================================
+ Coverage 62.24% 62.26% +0.02%
==========================================
Files 265 265
Lines 10448 10450 +2
Branches 2540 2541 +1
==========================================
+ Hits 6503 6507 +4
+ Misses 3360 3359 -1
+ Partials 585 584 -1
Continue to review full report at Codecov.
|
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.
Looks great, thank you for tackling it!
Can you update the changelog and sign the CLA, and I can merge this 🙂
d3541e4
to
39b2fe0
Compare
If 24.6.0 is somewhat away, it'd be awesome to have this fix in 24.5.1 🙏 The bug is blocking us from upgrading from Jest 23 and we can't wait to do this! @c0d3m3nt0r many thanks for your your time and effort! 🙌 |
@c0d3m3nt0r Still planning on publish this with 24.5.1 ? This is also preventing us from updating :/ |
A release is coming when we land the open PRs with performance improvements :) |
Seems like all pull requests mentioning Performance in their title have been merged 👀🙌 Well, at least the ones that were at the top of the PR list 😁 |
Can it be that because of this PR files that have zero covered lines are now totally ignored? I noticed a significantly higher coverage percentage after upgrading from 23 to 24 and then realised that uncovered files are simply removed from the reports 🤔 |
That might very well be! Would you be able to put together a reproduction? |
Only seeing this in our team's gigantic repo for now. Will try producing an MWE and submitting an issue 😉 |
It may well be that our ## Try collecting coverage with Jest 24
# cd new-empty-folder
cat << EOF > package.json
{
"jest": {
"collectCoverageFrom": [
"src/**/*.js"
]
}
}
EOF
cat << EOF > .babelrc
{ "presets": ["@babel/preset-env"] }
EOF
yarn add --dev @babel/core @babel/preset-env jest
mkdir src
cat << EOF > src/a.js
export default () => "a";
EOF
cat << EOF > src/b.js
export default () => "b";
EOF
cat << EOF > src/b.test.js
import b from "./b";
test("b works", () => {
expect(b()).toEqual("b");
});
EOF
yarn jest --coverage
## Downgrade to Jest 23
yarn remove --dev @babel/core @babel/preset-env jest
yarn add --dev babel-core babel-preset-es2015 jest@23
cat << EOF > .babelrc
{ "presets": ["es2015"] }
EOF
yarn jest --coverage Both source files ( |
Strange, but in the monorepo where I spotted the issue in the first place, Related issue: #8207 |
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
This PR is meant to fix #7758. In the provided GitHub issue link there are repro steps, also an explanation of the fix applied in this PR #7758 (comment).
Test plan
A new pair of tests were added to cover these changes.