Here is the output from running jest
on one of my components:
----------------------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------------------------|---------|----------|---------|---------|-------------------
All files | 100 | 100 | 50 | 100 |
search-suggestion-base.tsx | 100 | 100 | 50 | 100 |
----------------------------|---------|----------|---------|---------|-------------------
...
Jest: "global" coverage threshold for functions (100%) not met: 50%
Note that % Funcs
is not 100 and the test fails. (The coverage threshold is not set by me. I wouldn't have set such a high threshold.)
The problem is, Jest is not telling me which are the uncovered lines. Besides, I'm also having trouble figuring out what's the meaning of % Funcs
. I can't even find the official documentation for this % Funcs
.
Any help is appreciated!
.coverage/lcov-report/index.html
in the browser to check if there are uncovered lines? About how to read the coverage reporter, see #26618743 – Panda