Skip to content

Commit 10dd465

Browse files
authored
feat: Add LCOV reporting by default in karma remap instanbul reporter (#1657)
* feat: Add LCOV reporting by default in karma remap instanbul reporter * feat: add test to ensure lcov file is generated successfully after ng test
1 parent 7565f2d commit 10dd465

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

addon/ng2/blueprints/ng2/files/config/karma.conf.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ module.exports = function (config) {
2626
},
2727
remapIstanbulReporter: {
2828
reports: {
29-
html: 'coverage'
29+
html: 'coverage',
30+
lcovonly: './coverage/coverage.lcov'
3031
}
3132
},
3233
angularCliConfig: './angular-cli.json',

tests/e2e/e2e_workflow.spec.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,12 @@ describe('Basic end-to-end Workflow', function () {
289289
expect(existsSync(coverageReport)).to.be.equal(true);
290290
});
291291

292+
it('Make sure that LCOV file is generated inside coverage folder', function() {
293+
const lcovReport = path.join(process.cwd(), 'coverage', 'coverage.lcov');
294+
295+
expect(existsSync(lcovReport)).to.be.equal(true);
296+
});
297+
292298
it('moves all files that live inside `public` into `dist`', function () {
293299
this.timeout(420000);
294300

@@ -375,8 +381,8 @@ describe('Basic end-to-end Workflow', function () {
375381
let lessFile = path.join(componentPath, lessFilename);
376382
let lessExample = '.outer {\n .inner { background: #fff; }\n }';
377383
let componentContents = fs.readFileSync(componentFile, 'utf8');
378-
379-
sh.mv(cssFile, lessFile);
384+
385+
sh.mv(cssFile, lessFile);
380386
fs.writeFileSync(lessFile, lessExample, 'utf8');
381387
fs.writeFileSync(componentFile, componentContents.replace(new RegExp(cssFilename, 'g'), lessFilename), 'utf8');
382388

@@ -402,8 +408,8 @@ describe('Basic end-to-end Workflow', function () {
402408
let stylusFile = path.join(componentPath, stylusFilename);
403409
let stylusExample = '.outer {\n .inner { background: #fff; }\n }';
404410
let componentContents = fs.readFileSync(componentFile, 'utf8');
405-
406-
sh.mv(cssFile, stylusFile);
411+
412+
sh.mv(cssFile, stylusFile);
407413
fs.writeFileSync(stylusFile, stylusExample, 'utf8');
408414
fs.writeFileSync(componentFile, componentContents.replace(new RegExp(cssFilename, 'g'), stylusFilename), 'utf8');
409415

0 commit comments

Comments
 (0)