-
-
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
jest --watch doesn't show coverage in Vue #8364
Comments
Same here in React after upgrade
And I try to use create-react-app to creat an new app, copy my code and paste in new-app folder.
Then I copy all code include "node_modules" in new-app folder and paste in my old object.
??? envinfo
|
I'm experiencing this as well in a vanilla NodeJS project.
When run with Interestingly, when using envinfo
|
I notice that jest only tests files that are not in a git commit. To test files that regardless of git status i used --watchAll to get around this. |
Do you mean that these files should be untracked for jest to work properly? (without the workaround) |
at this stage, I think this is actually a feature. --watch is meant to run tests only on files that both:
--watchAll runs all tests on every file change. IMO it's just a little confusing for newbies (like myself) when using --watch and seeing no output. Perhaps this is an opportunity for clarification in the docs to make it absolutely obvious?? at this stage, i don't think it's a bug. In fact it's actually quite smart as it wont waste time running tests on files that have not changed. |
I think the core problem here is that as far as I can tell there is no workable way to use coverage with watch. This makes it very difficult to iteratively adjust tests to cover areas that are missed. This has proven to be a huge pain point for our team as we moved away from Karma which did support this usecase very well. |
@abierbaum how do you mean? Coverage and watch work well together. What isn’t working for you? |
@theonlydaleking Maybe I am doing something wrong, but if I start up jest with --watch and --coverage, I don't get any coverage details. It will run tests but won't show coverage. What I would like is to be able to use --watch and have any tests that are run on a change get updated coverage information that is output. |
Try —watchAll @abierbaum like I was saying before. Watch only runs tests on changed files |
@theonlydaleking Ok. Just tried that again and it appears to be working. My use case is actually to run watch and then immediately set a pattern with 'p' to zero in on the spec or subsystem I am actually working on testing. I didn't think that was working before, but appears to be now. Thanks for the pointer in the right direction. |
Looks like a bug. Is anyone interesting in getting a deep dive and fixing it? :) |
I was having the same issue. With Jest version 24.9.0 if I add --watchAll=false or --watchAll=false it works. Apparently is the only presence of --watchAll flag, at least for me. |
I'm also having that issue (just that I'm working with the Angular preset) and adding --watchAll=false didn't work for me.. :( |
It will show coverage when
perhaps the use case of the --watch is to run tests on changed files only, which kinda make sense that it doesn't produce coverage for all your files. but I think the best behavior for --watch + coverage, that it should somehow show the coverage of the changed files and not an |
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days. |
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🐛 Bug Report
Running
jest --watch
in a Vue project withcollectCoverage: true
andcollectCoverageFrom: ['src/**/*.{js,vue}']
doesn't show coverage.It works as expected when running just
jest
, but problem arises when runningjest --watch
To Reproduce
Run
jest
&jest --watch
in the reproduction repoExpected behavior
jest
works as expected, shows coverage infojest --watch
does not show any coverageLink to repl or repo (highly encouraged)
Repro: https://github.com/laggingreflex/repro-vue-jest-template
Run
npx envinfo --preset jest
The text was updated successfully, but these errors were encountered: