ember-cli-code-coverage mocha showing 0% coverage when there are tests

ember.jsCode CoverageEmber CliEmber Cli-Code-Coverage

ember.js Problem Overview


I'm using ember-cli-code-coverage with ember-cli-mocha. When I run COVERAGE=true ember test I'm getting 0% coverage for statements, functions, and lines. Yet, I have tests that are covering those sections. Any I missing something in my setup?

enter image description here

unit test file:

  beforeEach(function() {
    controller = this.subject();
  });

  it('sets selectedImage to null', function() {
    expect(controller.get('selectedImage')).to.eql(null);
  });

  describe('setCoverageTest', function() {
    it('sets selectedImage to true', function()  {
      expect(controller.get('selectedImage')).to.eql(null);
      controller.setCoverageTest();
      expect(controller.get('selectedImage')).to.be.true;
    });
  });

config/coverage.js:

module.exports = {
  excludes: ['*/templates/**/*'],
  useBabelInstrumenter: true
};

ember.js Solutions


Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionwwwuserView Question on Stackoverflow