Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ember CLI and code coverage

Has anyone managed to get code coverage working with an Ember CLI project?

I've tried using blanket.js and istanbul, as have others here, here and here, neither with any success. I've managed to get each to actually produce a coverage report but the report either says 0% (istanbul) or 100% (blanket.js), and there's no way the current tests provide 100% coverage.

The built project JavaScript file that Ember CLI produces contains all of the project's source files with each file's contents being output onto one, sometimes massive, line. So even if the coverage tool was able to produce the actual coverage metrics for the code in the built file there's then the issue of viewing the results. God only knows how you would link this back to the original source files?

Ember CLI is great and seems popular so I'm surprised more people haven’t had this issue. Perhaps others aren't as bothered by code coverage or maybe most just get it working without issue and I'm missing something.

like image 414
Wungsow Avatar asked Oct 13 '14 09:10

Wungsow


1 Answers

AFAIK, ember-cli-code-coverage provides the most accurate and easy to configure solution for coverage in ember-cli applications.It creates readable coverage reports for each file in the app/ directory. It is based on istanbul.

like image 145
efx Avatar answered Oct 11 '22 16:10

efx