我正在ember-cli-code-coverage使用ember-cli-mocha。当我运行COVERAGE=true ember test
时,我的语句,函数和行的覆盖率为0%。然而,我的测试涵盖了这些部分。我在设置中遗漏了什么?
单元测试文件:
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
};