Added coverage reporter
diff --git a/.gitignore b/.gitignore
index e91dffb..cc49c01 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,4 +6,5 @@
xos/configurations/frontend/Dockerfile
xos/core/xoslib/karma-*
xos/core/xoslib/docs
+xos/core/xoslib/coverage
node_modules
diff --git a/xos/configurations/frontend/README.md b/xos/configurations/frontend/README.md
index 9f0a754..0cb1363 100644
--- a/xos/configurations/frontend/README.md
+++ b/xos/configurations/frontend/README.md
@@ -38,6 +38,8 @@
You can find the tests in the `spec/` folder, each source file has a corresponding `.test` file in it.
+After test have run you can find a Coverage report in `xos/core/xoslib/coverage` folder
+
## JS Styleguide
This project is following [Google JavaScript Style Guide](https://google.github.io/styleguide/javascriptguide.xml). To contribute please install [Eslint](http://eslint.org/) in your editor and run `npm run eslint` before commit.
diff --git a/xos/core/xoslib/karma.conf.js b/xos/core/xoslib/karma.conf.js
index 7452ffc..0d0b15b 100644
--- a/xos/core/xoslib/karma.conf.js
+++ b/xos/core/xoslib/karma.conf.js
@@ -53,7 +53,7 @@
exclude: [
// '**/xos-utils.test.js', //skip this test, useful in dev, comment before commit
// '**/xos-backbone.test.js',
- '**/xoslib/**/*.js'
+ // '**/xoslib/**/*.js'
],
@@ -61,7 +61,9 @@
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'spec/**/*.test.js': ['babel'],
- 'static/templates/**/*.html': 'ng-html2js'
+ 'static/templates/**/*.html': 'ng-html2js',
+ 'static/js/xoslib/*.js': ['coverage'],
+ 'static/js/*.js': ['coverage']
},
ngHtml2JsPreprocessor: {
@@ -69,11 +71,15 @@
moduleName: 'templates' // define the template module name
},
+ coverageReporter: {
+ type: 'html',
+ dir: 'coverage/'
+ },
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
- reporters: ['mocha'],
+ reporters: ['mocha', 'coverage'],
// web server port
diff --git a/xos/core/xoslib/package.json b/xos/core/xoslib/package.json
index 980ff85..c512432 100644
--- a/xos/core/xoslib/package.json
+++ b/xos/core/xoslib/package.json
@@ -17,8 +17,9 @@
"ink-docstrap": "^0.5.2",
"jasmine-core": "~2.3.4",
"jsdoc": "^3.3.3",
- "karma": "~0.13.10",
+ "karma": "^0.13.14",
"karma-babel-preprocessor": "~5.2.2",
+ "karma-coverage": "^0.5.3",
"karma-jasmine": "~0.3.6",
"karma-mocha-reporter": "~1.1.1",
"karma-ng-html2js-preprocessor": "^0.2.0",