Skip to content

Commit

Permalink
feat: Add LCOV reporting by default in karma remap instanbul reporter (
Browse files Browse the repository at this point in the history
…#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
  • Loading branch information
TheLarkInn authored Aug 12, 2016
1 parent 7565f2d commit 10dd465
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion addon/ng2/blueprints/ng2/files/config/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ module.exports = function (config) {
},
remapIstanbulReporter: {
reports: {
html: 'coverage'
html: 'coverage',
lcovonly: './coverage/coverage.lcov'
}
},
angularCliConfig: './angular-cli.json',
Expand Down
14 changes: 10 additions & 4 deletions tests/e2e/e2e_workflow.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,12 @@ describe('Basic end-to-end Workflow', function () {
expect(existsSync(coverageReport)).to.be.equal(true);
});

it('Make sure that LCOV file is generated inside coverage folder', function() {
const lcovReport = path.join(process.cwd(), 'coverage', 'coverage.lcov');

expect(existsSync(lcovReport)).to.be.equal(true);
});

it('moves all files that live inside `public` into `dist`', function () {
this.timeout(420000);

Expand Down Expand Up @@ -375,8 +381,8 @@ describe('Basic end-to-end Workflow', function () {
let lessFile = path.join(componentPath, lessFilename);
let lessExample = '.outer {\n .inner { background: #fff; }\n }';
let componentContents = fs.readFileSync(componentFile, 'utf8');
sh.mv(cssFile, lessFile);

sh.mv(cssFile, lessFile);
fs.writeFileSync(lessFile, lessExample, 'utf8');
fs.writeFileSync(componentFile, componentContents.replace(new RegExp(cssFilename, 'g'), lessFilename), 'utf8');

Expand All @@ -402,8 +408,8 @@ describe('Basic end-to-end Workflow', function () {
let stylusFile = path.join(componentPath, stylusFilename);
let stylusExample = '.outer {\n .inner { background: #fff; }\n }';
let componentContents = fs.readFileSync(componentFile, 'utf8');
sh.mv(cssFile, stylusFile);

sh.mv(cssFile, stylusFile);
fs.writeFileSync(stylusFile, stylusExample, 'utf8');
fs.writeFileSync(componentFile, componentContents.replace(new RegExp(cssFilename, 'g'), stylusFilename), 'utf8');

Expand Down

0 comments on commit 10dd465

Please sign in to comment.