Unit test coverage not showing the full files in report

I could run unit test using the command below.
But the problem it is not showing the missing unit tests.

Is there any way to show all the source files in the report and show the one which are missing as well.
Currenly I have written only one server side test and the report just picks up the same file in coverage report and shows as 96%.

I could see it is picking all file if I use --full-app mode,but then it will only pick the acceptance test case more like an integration scenario and also for it to be mapped properly I need to use -app.test format as well.

Is there any way to get the unit test coverage of all the files with out actually writing the unit test file for the source.

COVERAGE_VERBOSE=1 COVERAGE_OUT_HTML=1 COVERAGE=1 COVERAGE_APP_FOLDER=/ spacejam test --driver-package meteortesting:mocha --coverage out_coverage

Thanks,
Sarath.

1 Like

Hello Sarath,
I’m the author of meteor-coverage. Happy to see that things are working great on your side. Please don’t forget to update to the last version of meteor-coverage, you should not use spacejam anymore (only meteortesting stuff).

What you see is the HTML report that my spacejam fork produces. But that’s not the only way to see your code report.

Two things : you will never see unimported files (from your tests suite) appearing in the coverage report. That’s how it’s done internaly in the core of Meteor, it just takes files that matters and not all files.

On the other hand, if you use Sonar (for self hosted repo) or Coveralls / Codecov / Codacy (Public or Saas repo) you see all yours files with the coverage of all files.

2 Likes

Thanks I could see it shows the coverage if I have a test setup file which imports all files.

Hello serutan,
For sonar,as you mentioned it is showing the full list in coverage.
However the paths in lcov seems to be only working if I do the below before passing to sonar.

sed ‘s////’ lcov.info > lcov.info.formatted

Thanks,
Sarath.

What is the simplest way to force all files in the coverage output? Write a dummy test that imports main/client and main/server?