Commit 6e5fa2b1f2ed052038cf88ac59cb08a7fd9553d6

Authored by Leonardo Merlin
1 parent 58369d42

Add karma coverage deps

Showing 3 changed files with 27 additions and 11 deletions   Show diff stats
.gitignore
... ... @@ -4,6 +4,7 @@ bower_components/
4 4 .idea/
5 5 .tmp/
6 6 dist/
  7 +coverage/
7 8 .editorconfig
8 9 script-staging.sh
9 10  
... ...
karma.conf.js
... ... @@ -13,12 +13,12 @@ function listFiles() {
13 13 });
14 14  
15 15 return wiredep(wiredepOptions).js
16   - .concat([
17   - path.join(conf.paths.src, '/app/**/*.module.js'),
18   - path.join(conf.paths.src, '/app/**/*.js'),
19   - path.join(conf.paths.src, '/**/*.spec.js'),
20   - path.join(conf.paths.src, '/**/*.mock.js'),
21   - path.join(conf.paths.src, '/**/*.html')
  16 + .concat([
  17 + path.join(conf.paths.src, '/app/**/*.module.js'),
  18 + path.join(conf.paths.src, '/app/**/*.js'),
  19 + path.join(conf.paths.src, '/**/*.spec.js'),
  20 + path.join(conf.paths.src, '/**/*.mock.js'),
  21 + path.join(conf.paths.src, '/**/*.html')
22 22 ]);
23 23 }
24 24  
... ... @@ -45,14 +45,26 @@ module.exports = function(config) {
45 45 browsers : ['PhantomJS'],
46 46  
47 47 plugins : [
48   - 'karma-phantomjs-launcher',
49   - 'karma-angular-filesort',
50   - 'karma-jasmine',
51   - 'karma-ng-html2js-preprocessor'
  48 + 'karma-jasmine',
  49 + 'karma-coverage',
  50 + 'karma-angular-filesort',
  51 + 'karma-ng-html2js-preprocessor',
  52 + 'karma-phantomjs-launcher',
  53 + 'karma-chrome-launcher',
  54 + 'karma-firefox-launcher'
52 55 ],
53 56  
54 57 preprocessors: {
55   - 'src/**/*.html': ['ng-html2js']
  58 + 'src/**/*.html': ['ng-html2js'],
  59 + 'src/app/**/*.js': ['coverage']
  60 + },
  61 +
  62 + reporters: ['progress', 'coverage'],
  63 +
  64 + coverageReporter: {
  65 + type : 'lcov', // HTML + LCOV
  66 + // type : 'cobertura', // supported by jenkins
  67 + dir : 'coverage/'
56 68 }
57 69 };
58 70  
... ...
package.json
... ... @@ -39,6 +39,9 @@
39 39 "jshint-stylish": "~2.0.0",
40 40 "karma": "~0.12.36",
41 41 "karma-angular-filesort": "~0.1.0",
  42 + "karma-chrome-launcher": "^0.2.1",
  43 + "karma-coverage": "^0.5.3",
  44 + "karma-firefox-launcher": "^0.1.7",
42 45 "karma-jasmine": "~0.3.5",
43 46 "karma-ng-html2js-preprocessor": "~0.1.2",
44 47 "karma-phantomjs-launcher": "~0.2.0",
... ...