-
-
Notifications
You must be signed in to change notification settings - Fork 26.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
Issue when running tests with --watchAll=false --coverage #8689
Comments
One thing I noticed is that if you remove |
I'm getting the same error without --watchAll |
Same issue here with Message
Github action |
@kentcdodds possible root cause: combination of babel 7.9 and jest 24.9 in react-scripts 3.4.1 in case forcing jest to v 25.1 test coverage works as expected {
"resolutions": {
"jest": "25.1.0"
},
"scripts": {
"test:coverage": "SKIP_PREFLIGHT_CHECK=true CI=true react-scripts test --coverage"
}
} (#8362) |
Babel 7.9.3 was just release too, with some issues that may well be related to this |
I think this may have fixed itself. rm -rf node_modules
rm package-lock.json
npm install
CI=true npm test -- --coverage Edit 1: I experienced this all day yesterday (3/21). It is not longer occurring for me (3/22) on either existing Edit 2: Using |
We are experiencing this with the |
This is likely a problem with the Babel plugin jest uses for coverage reporting. One potential solution is to use v8's built-in coverage reporting via the "coverageProvider" option |
Same issue here too. Running tests with |
@ambroseus none of the above worked for me |
I just did a fresh |
Getting the same error when running I think I'm using the latest modules ( ├── @babel/core@7.9.0
├── @babel/plugin-proposal-class-properties@7.8.3
├── @babel/preset-env@7.9.0
├── @babel/preset-react@7.9.4
├── @frontendmasters/pet@1.0.3
├── @reach/router@1.3.3
├── @testing-library/react@10.0.1
├── babel-eslint@10.1.0
├── cross-env@7.0.2
├── eslint@6.8.0
├── eslint-config-prettier@6.10.1
├── eslint-plugin-import@2.20.1
├── eslint-plugin-jsx-a11y@6.2.3
├── eslint-plugin-react@7.19.0
├── eslint-plugin-react-hooks@2.5.1
├── jest@25.2.3
├── parcel-bundler@1.12.4
├── prettier@2.0.2
├── react@16.13.1
├── react-dom@16.13.1
└── rimraf@3.0.2 |
a week ago this error appeared, but today I've cleared the cache and the build passed |
Ran into this issue today. Downgraded to |
Downgrading to |
facebook/create-react-app#8689 is causing our tests to fail in the CI pipeline. As the comments suggest, downgrading to react-scripts 3.4.0 fixes the problem. In addition, fix a test warning due to a missing id field. Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>
facebook/create-react-app#8689 is causing our tests to fail in the CI pipeline. As the comments suggest, downgrading to react-scripts 3.4.0 fixes the problem. In addition, fix a test warning due to a missing id field. Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>
@babel/core@7.9.0 Same here above it list of all direct dependancies. Upgrading jest does not help either. Any help would be appreciated. One thing I noticed is that if I write and return jsx in this fashion it works.
|
same issue here downgrading to |
same issue here. |
I was encountering this issue as well when using jest with the |
Same issue. |
I've the same problem |
Can confirm going to react-scripts 3.4.0 also resolved this issue for me. |
due to bug with coverage - facebook/create-react-app#8689
Thanks, @ambroseus, your solution worked so I can avoid downgrading react-scripts. As of today 22/april 2020, is it work on this? Are there any plans to fix this bug? If there is a lack of devs, I offer myself to work on this bug. However not sure if this needs so many fixed dependencies or something similar |
Interestingly enough, the coverage report still gets produced accurately, despite all the errors in the console. |
- There appears to be a bug in react-scripts that causes running the tests with coverage to fail when in CI mode or if --watchAll=false - Downgrading react-scripts from 3.4.1 to 3.4.0 seems to fix the problem as a workaround for now - See facebook/create-react-app#8689 for more information
- There appears to be a bug in react-scripts that causes running the tests with coverage to fail when in CI mode or if --watchAll=false - Downgrading react-scripts from 3.4.1 to 3.4.0 seems to fix the problem as a workaround for now - See facebook/create-react-app#8689 for more information
version 3.4.1 has a bug see: facebook/create-react-app#8689
I was pulling my hair out over this issue but as able to fix it. Problem was that on CI, Create-React-App was defaulting to yarn, which messed up an install somehow, which did not happen on my local machine as I do not have yarn installed. If you are having this issue (and you don't want to downgrade to 3.4.0, try using |
Describe the bug
When I attempt to run my tests with coverage in CI (or locally for that matter) I get an error:
App(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.
Did you try recovering your dependencies?
N/A (happens on a fresh bootstrap of a new app
Which terms did you search for in User Guide?
N/A, though I did search for the error in the issues and found nothing
Environment
Steps to reproduce
Reproduction steps:
Expected behavior
I expect the test to pass and coverage to be reported
Actual behavior
Here's the relevant output:
Reproducible demo
The reproduction steps should be enough. You don't need to change anything about the generated project.
I am also experiencing this in all of my
react-scripts
apps. I think this only started happening in the last week or so.The text was updated successfully, but these errors were encountered: