Skip to content

Commit

Permalink
feat (CodeCoverage): use karma-remap-istanbul (#1468)
Browse files Browse the repository at this point in the history
  • Loading branch information
Danny Blue authored and filipesilva committed Aug 4, 2016
1 parent 5ea4b03 commit 36c0ee5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
11 changes: 8 additions & 3 deletions addon/ng2/blueprints/ng2/files/config/karma.conf.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand All @@ -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: {
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion addon/ng2/blueprints/ng2/files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions addon/ng2/models/webpack-build-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
},
{
Expand All @@ -70,7 +69,8 @@ const getWebpackTestConfig = function(projectRoot, sourceDir) {
exclude: [
/\.(e2e|spec)\.ts$/,
/node_modules/
]
],
query: { 'force-sourcemap': true }
}
]
},
Expand Down
6 changes: 6 additions & 0 deletions tests/e2e/e2e_workflow.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 36c0ee5

Please sign in to comment.