Coverage unknown with exclusion pattern in "testMatch"
See original GitHub issue🐛 Bug Report
Coverage becomes unknown after adding an exclusion patter to the testMatch
config option.
|-----------|----------|----------|----------|----------|-------------------|
| File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
|-----------|----------|----------|----------|----------|-------------------|
| All files | Unknown | Unknown | Unknown | Unknown | |
|-----------|----------|----------|----------|----------|-------------------|
To Reproduce
- Clone example repo +
npm install
- Run
jest --coverage
(should show unknown coverage) - Remove line
11
inpackage.json
- Run
jest --coverage
(should show correct coverage)
Expected behavior
Coverage report should be the same with or without the exclusion pattern.
Link to repl or repo (highly encouraged)
https://github.com/g-harel/jest-7165
Run npx envinfo --preset jest
System:
OS: Linux 4.15 Ubuntu 18.04.1 LTS (Bionic Beaver)
CPU: x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
Binaries:
Node: 9.5.0 - ~/.nvm/versions/node/v9.5.0/bin/node
npm: 6.4.1 - ~/.nvm/versions/node/v9.5.0/bin/npm
npmPackages:
jest: ^23.6.0 => 23.6.0
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Top Results From Across the Web
c# - How to test or exclude private unreachable code from ...
I would like to be able to either find a pattern where I can eliminate that "untestable" code, test it or mark that...
Read more >Test coverage visualization - GitLab Docs
With the help of GitLab CI/CD, you can collect the test coverage information of your favorite testing or coverage-analysis tool, and visualize this ......
Read more >Configuring Jest
If a file matches the specified glob pattern, coverage information will be collected for it even if no tests exist for this file...
Read more >Configuring Vitest
Files to exclude from the test run, using glob pattern. ... When defined, Vitest will run all matched files with import.meta.vitest inside.
Read more >A Guide to Pattern Matching in Vavr - Baeldung
In this section, we have covered the basics of Vavr pattern matching and the following sections will cover various approaches to tackling ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m still getting the exact same issue on Jest v24.3.1. Removing the exclusion pattern fixes it.
Jest config:
Env info:
@g-harel that would be great, after getting the repo running locally, I would start in the reporter here and work backward. You may end up here at some point