diff --git a/addon/ng2/blueprints/ng2/files/config/karma.conf.js b/addon/ng2/blueprints/ng2/files/config/karma.conf.js index 118cdc2e7721..b8aa26e084b2 100644 --- a/addon/ng2/blueprints/ng2/files/config/karma.conf.js +++ b/addon/ng2/blueprints/ng2/files/config/karma.conf.js @@ -1,4 +1,4 @@ -// Karma configuration file, see link for more information +// Karma configuration file, see link for more information // https://karma-runner.github.io/0.13/config/configuration-file.html module.exports = function (config) { @@ -8,7 +8,7 @@ module.exports = function (config) { plugins: [ require('karma-jasmine'), require('karma-chrome-launcher'), - require('karma-coverage'), + require('karma-remap-istanbul'), require('angular-cli/plugins/karma') ], customLaunchers: { @@ -24,8 +24,13 @@ module.exports = function (config) { preprocessors: { './src/test.ts': ['angular-cli'] }, + remapIstanbulReporter: { + reports: { + html: 'coverage' + } + }, angularCliConfig: './angular-cli.json', - reporters: ['coverage', 'progress'], + reporters: ['progress', 'karma-remap-istanbul'], port: 9876, colors: true, logLevel: config.LOG_INFO, diff --git a/addon/ng2/blueprints/ng2/files/package.json b/addon/ng2/blueprints/ng2/files/package.json index 161087266c4c..ca5bead3b842 100644 --- a/addon/ng2/blueprints/ng2/files/package.json +++ b/addon/ng2/blueprints/ng2/files/package.json @@ -42,8 +42,8 @@ "jasmine-spec-reporter": "2.5.0", "karma": "0.13.22", "karma-chrome-launcher": "0.2.3", - "karma-coverage": "^1.0.0", "karma-jasmine": "0.3.8", + "karma-remap-istanbul": "^0.2.1", "protractor": "3.3.0", "ts-node": "1.2.1", "tslint": "3.13.0", diff --git a/addon/ng2/models/webpack-build-test.js b/addon/ng2/models/webpack-build-test.js index 5ed3d5c55ff8..a57313156b1f 100644 --- a/addon/ng2/models/webpack-build-test.js +++ b/addon/ng2/models/webpack-build-test.js @@ -46,8 +46,7 @@ const getWebpackTestConfig = function(projectRoot, sourceDir) { tsconfig: path.resolve(projectRoot, `./${sourceDir}/tsconfig.json`), module: 'commonjs', target: 'es5', - useForkChecker: true, - removeComments: true + useForkChecker: true } }, { @@ -70,7 +69,8 @@ const getWebpackTestConfig = function(projectRoot, sourceDir) { exclude: [ /\.(e2e|spec)\.ts$/, /node_modules/ - ] + ], + query: { 'force-sourcemap': true } } ] }, diff --git a/tests/e2e/e2e_workflow.spec.js b/tests/e2e/e2e_workflow.spec.js index 1aaa5159f3b7..deb515ffd943 100644 --- a/tests/e2e/e2e_workflow.spec.js +++ b/tests/e2e/e2e_workflow.spec.js @@ -283,6 +283,12 @@ describe('Basic end-to-end Workflow', function () { }); }); + it('Make sure the correct coverage folder is created', function () { + const coverageReport = path.join(process.cwd(), 'coverage', 'src', 'app'); + + expect(existsSync(coverageReport)).to.be.equal(true); + }); + it('moves all files that live inside `public` into `dist`', function () { this.timeout(420000);