lundi 21 août 2017

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

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
};




Aucun commentaire:

Enregistrer un commentaire