edit: a few months later I migrated over to Lab completely, it works great, including coverage. Maybe at the time I wrote this Lab didn't have a good coverage tool.
I've gotten this working before. Was working this morning. Suddenly, it's not.
Tests are in dist/test/unit.js
. 15 tests that cover 80.29% of code (based on Lab's coverage reports). But we are setup to use Istanbul with Sonar, so I need to get it working with Istanbul again. I prefer Istanbul's reports anyway.
I'm running the tests with:
./node_modules/.bin/istanbul cover ./node_modules/.bin/lab -- -l -e development -r lcov dist/test
The tests run. All pass. The screen output is a coverage report:
...
DA:801,1
DA:802,1
DA:803,1
DA:804,1
DA:805,1
DA:806,1
DA:807,1
LF:774
LH:738
end_of_record
No coverage information was collected, exit without writing coverage information
Why is this telling me that no coverage was collected? How do I get these two tools to play nicely together again?
Getting rid of -r lcov
doesn't really help. There is no output in ./coverage
(the default folder) either way. I can force it by piping but when I run that output to istanbul (report option) I get Error: Invalid report format [coverage/cover.info]
It seems like the coverage report that's being generated is invalid. How would I know?