From 3a27c909b777304490d0900cbdccf55492ee1462 Mon Sep 17 00:00:00 2001 From: Sean Larkin Date: Thu, 11 Aug 2016 22:33:22 -0500 Subject: [PATCH 1/2] feat: Add LCOV reporting by default in karma remap instanbul reporter --- addon/ng2/blueprints/ng2/files/config/karma.conf.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addon/ng2/blueprints/ng2/files/config/karma.conf.js b/addon/ng2/blueprints/ng2/files/config/karma.conf.js index b8aa26e084b2..05eb0173085b 100644 --- a/addon/ng2/blueprints/ng2/files/config/karma.conf.js +++ b/addon/ng2/blueprints/ng2/files/config/karma.conf.js @@ -26,7 +26,8 @@ module.exports = function (config) { }, remapIstanbulReporter: { reports: { - html: 'coverage' + html: 'coverage', + lcovonly: './coverage/coverage.lcov' } }, angularCliConfig: './angular-cli.json', From 6e61bf57885f9748a9d30f5734f4b1b14dccabbe Mon Sep 17 00:00:00 2001 From: Sean Larkin Date: Thu, 11 Aug 2016 22:41:53 -0500 Subject: [PATCH 2/2] feat: add test to ensure lcov file is generated successfully after ng test --- tests/e2e/e2e_workflow.spec.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/e2e/e2e_workflow.spec.js b/tests/e2e/e2e_workflow.spec.js index deb515ffd943..d4522f6e4725 100644 --- a/tests/e2e/e2e_workflow.spec.js +++ b/tests/e2e/e2e_workflow.spec.js @@ -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); @@ -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'); @@ -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');