Skip to content
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

jest --watch doesn't show coverage #174

Closed
laggingreflex opened this issue Apr 23, 2019 · 1 comment
Closed

jest --watch doesn't show coverage #174

laggingreflex opened this issue Apr 23, 2019 · 1 comment

Comments

@laggingreflex
Copy link

Running jest --watch with collectCoverage: true and collectCoverageFrom: ['src/**/*.{js,vue}'] doesn't show coverage.

It works as expected when running just jest, but problem arises when running jest --watch

To Reproduce

Run jest & jest --watch in the reproduction repo

Expected behavior

jest works as expected, shows coverage info

> jest

 PASS  src/test.js
  test
    √ test (3ms)

------------|----------|----------|----------|----------|-------------------|
File        |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |
------------|----------|----------|----------|----------|-------------------|
All files   |    57.14 |       50 |        0 |    57.14 |                   |
 src        |        0 |      100 |      100 |        0 |                   |
  index.js  |        0 |      100 |      100 |        0 |             2,3,5 |
 src/App    |    72.73 |       50 |        0 |    72.73 |                   |
  index.vue |    72.73 |       50 |        0 |    72.73 |            7,8,11 |
------------|----------|----------|----------|----------|-------------------|
Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        5.748s
Ran all test suites.

jest --watch does not show any coverage

> jest --watch

 PASS  src/test.js
  test
    √ test (7ms)

----------|----------|----------|----------|----------|-------------------|
File      |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |
----------|----------|----------|----------|----------|-------------------|
All files |        0 |        0 |        0 |        0 |                   |
----------|----------|----------|----------|----------|-------------------|
Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        5.985s
Ran all test suites.

Watch Usage: Press w to show more.

Link to repl or repo

Repro: https://github.com/laggingreflex/repro-vue-jest-template

npx envinfo --preset jest

  System:
    OS: Windows 10
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
  Binaries:
    Node: 10.15.0
    npm: 6.4.1

Linked: jestjs/jest#8364

@eddyerburgh
Copy link
Member

Thank you for the bug report, but it doesn't look like this is caused by vue-jest (since there are reports in the linked issue for users not using vue-jest)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants