Code coverage report is empty
See original GitHub issueGiven the following file structure:
src
- example.js
test
- my-first-test.js
example.js
module.exports = {
everything: function () {
return 'cool';
}
}
my-first-test.js
let { everything } = require('../src/example');
export function testThatEverythingIsCool(t) {
let result = everything();
t.assert(result === 'cool', 'Make sure that everything is cool');
}
Running npx luna test/* --node --verbose
results in the following:
🌙 Running tests…
✔︎ [test/my-first-test.js] testThatEverythingIsCool
All tests passed!
----------|----------|----------|----------|----------|-------------------|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
----------|----------|----------|----------|----------|-------------------|
All files | 0 | 0 | 0 | 0 | |
----------|----------|----------|----------|----------|-------------------|
=============================== Coverage summary ===============================
Statements : Unknown% ( 0/0 )
Branches : Unknown% ( 0/0 )
Functions : Unknown% ( 0/0 )
Lines : Unknown% ( 0/0 )
================================================================================
HTML coverage report available at coverage/lcov-report/index.html
Took 0.55 seconds
Maybe I’m running it wrong somehow, but shouldn’t it be showing 100% coverage for this simple test?
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Empty Code Coverage Report · Issue #532 - gcov - GitHub
Hello, I am running ceedling and gcov for a project of mine. Ceedling runs fine, GCov runs fine. However my generated report is...
Read more >Re: Code coverage report empty - Google Groups
I get a blank coverage report with 100% and no files. My config looks like this: // base path, that will be used...
Read more >Code Coverage results empty (again) - Visual Studio Feedback
We found out that some customers have issue with missing code coverage dependencies. We are fixing it. A fix for this issue has...
Read more >Code coverage statistics data is empty and ... - Stack Overflow
I'm using Jacoco for code coverage and visualizing it, visualizing is working well but Code coverage statistics data is empty and the ...
Read more >OpenCover generates an empty report - SonarQube
I want to get the code coverage report. Using dotnet CLI to run the tests. The tests are running and the file is...
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
Aha! I found a solution…
If you do
Then run as
it works!
Haha yup. that looks like a bug with yargs though. Or at least my expectation of how it should work. If you pass
--no-coverage=1
it works, but passing it alone does not work.Oh wow. It is the library itself being smarter than I am. If you name a flag
--no-{flag}
it comes in asflag: false
. Instead of'no-{flag}': true
which was what I expected here. Personally I think the library is trying to be too smart, it should add both, but it is an easy fix