当有测试时,ember-cli-code-coverage mocha显示0%的覆盖率

时间:2017-08-21 21:34:40

标签: ember.js ember-cli ember-cli-code-coverage

我正在ember-cli-code-coverage使用ember-cli-mocha。当我运行COVERAGE=true ember test时,我的语句,函数和行的覆盖率为0%。然而,我的测试涵盖了这些部分。我在设置中遗漏了什么?

enter image description here

单元测试文件:

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

配置/ coverage.js:

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

0 个答案:

没有答案