This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Add coverage support for coveralls (#900)

* Add coverage support for coveralls

* Gather code coverage when npm run test

* 🚀
  • Loading branch information...
minuscorp authored and nakhbari committed May 31, 2018
1 parent 42f6ef7 commit 385e54a924e4a9642adfd2e8d95925807923ac8c
Showing with 16 additions and 4 deletions.
  1. +12 −3 karma.conf.js
  2. +4 −1 package.json
View
@@ -1,12 +1,19 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
const coverage_reporters = [
{ type: 'text-summary' },
{ type : 'lcov', dir : 'coverage' }
];
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
plugins: [
require('karma-jasmine'),
require('karma-coverage'),
require('karma-coveralls'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
@@ -19,15 +26,17 @@ module.exports = function (config) {
reports: [ 'html', 'lcovonly' ],
fixWebpackSourcePaths: true
},
coverageReporter: {
reporters: coverage_reporters,
},
angularCli: {
environment: 'dev'
},
reporters: ['progress', 'kjhtml'],
reporters: ['progress', 'kjhtml', 'coverage-istanbul', 'coverage', 'coveralls' ],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
browsers: ['Chrome']
});
};
View
@@ -6,8 +6,8 @@
"ng": "ng",
"start": "ng serve",
"build": "ng build --deploy-url=\"/.dist\" --prod",
"test": "ng test -sm=false -watch=false --code-coverage",
"build_watch": "ng build --deploy-url=\"/.dist\" -w",
"test": "ng test -sm=false -watch=false",
"test_watch": "ng test -sm=false",
"lint": "ng lint",
"lintfix": "ng lint --fix"
@@ -40,11 +40,14 @@
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "^4.0.1",
"coveralls": "^3.0.1",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage": "^1.1.2",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-coveralls": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",

0 comments on commit 385e54a

Please sign in to comment.