question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

test coverage is empty - v3.0.0

See original GitHub issue

Is this a bug report?

yes, test coverage is always empty

After updating react-scripts to 3.0.0 test coverage is always empty, this worked before in v2.1.8


v2.1.8

Screenshot 2019-04-24 at 16 17 37

v3.0.0

Screenshot 2019-04-24 at 16 19 22

Did you try recovering your dependencies?

This happens after booting an app up using create react app using typescript create-react-app cra-coverage-example --typescript

Which terms did you search for in User Guide?

n/a

Environment

Environment Info:

  System:
    OS: macOS 10.14.4
    CPU: x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
  Binaries:
    Node: 11.12.0 - ~/.nvm/versions/node/v11.12.0/bin/node
    Yarn: 1.15.2 - /usr/local/bin/yarn
    npm: 6.7.0 - ~/.nvm/versions/node/v11.12.0/bin/npm
  Browsers:
    Chrome: 73.0.3683.103
    Safari: 12.1
  npmPackages:
    react: ^16.8.6 => 16.8.6
    react-dom: ^16.8.6 => 16.8.6
    react-scripts: 3.0.0 => 3.0.0
  npmGlobalPackages:
    create-react-app: Not Found

Steps to Reproduce

  1. create-react-app cra-coverage-example --typescript
  2. yarn test --coverage

Expected Behavior

test coverage would be output

Actual Behavior

test coverage is always empty

Reproducible Demo

https://github.com/pete-redmond-cko/cra-coverage-example or you can spin up an app using create react app v.3.0.0 and run yarn test --coverage

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:19
  • Comments:39 (2 by maintainers)

github_iconTop GitHub Comments

36reactions
bugzpoddercommented, Apr 24, 2019

If you turn off watch via: yarn test --coverage --watchAll=false

It will work properly. Looks like a Jest bug. @stipsan

5reactions
mraakcommented, Apr 29, 2019

Jest needs more Jest tests to test the Jest.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Code Coverage in react app is empty? Tried using npm ...
I have just created a new app using the latest create-react-app. I am trying to find the code coverage using npm run test...
Read more >
Code Coverage results empty (again) - Visual Studio Feedback
After upgrading to VS 16.8.0 Preview 3 the Code Coverage Results has stopped working in my .NET Core Unit Tests (5.0 rc1) (.NET...
Read more >
Adding coverage to your repository - Codacy Quality docs
Generate coverage reports in a supported format and upload them to Codacy to monitor the code coverage of your repositories on Codacy.
Read more >
Use code coverage for unit testing - .NET | Microsoft Learn
Code coverage is a measurement of the amount of code that is run by unit tests - either lines, branches, or methods. As...
Read more >
Code coverage - utPLSQL-framework
To obtain information about code coverage for unit tests, ... the code that is being tested will be reported as not covered (coverage...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found