You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test_runner: coverage reports the largest block count as the function call count (FNDA) #67319
How often does it reproduce? Is there a required condition?
Always, when a block inside a function runs more often than the function is called.
What is the expected behavior? Why is that the expected behavior?
sum is called once:
FN:1,sum
FNDA:1,sum
In LCOV, FNDA is the number of times the function was called, and the test:coverage docs describe functions[].count as the number of times the function was called.
The same value appears in summary.files[].functions[].count of the test:coverage event.
Additional information
In TestCoverage.summary() (lib/internal/test_runner/coverage.js), the function report uses count: maxCountPerFunction, the maximum over all block ranges, instead of ranges[0].count, the function range's own count.
Found with a differential-testing tool; the report was drafted with AI assistance and reviewed and edited by me.
Activity