Skip to content

Commit

Permalink
Attempt to support code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
atruskie committed Jun 5, 2014
1 parent bdbdf70 commit 9cb5531
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ node_js:

# Karma requires a specific version due to dependency issues.
before_install:
- npm install --quiet -g karma@0.10.10
- npm install --quiet -g karma codeclimate-test-reporter

before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- npm install --quiet -g grunt-cli bower
- bower install
# Code climate token encypted with travis gem (travis encrypt CODECLIMATE_REPO_TOKEN=fdf...)
- secure: "B6crMr+aI2PceikzXp2XfXmttPSyLWCMXBIBwKWlfTKP8zlagwQ5AHTLe2t2Kv5mdlxe8pOhMDAO7QTClGWmqxf5H1hVqjqw0kc5SDwkAWZUSSOQKaaD3qeNFlmKv3ELmOWHrycDTWq5Exvnlj7q6MG2bYf4JP7Z3dE4UeZClpo="

script: grunt
script:
- grunt
- codeclimate < coverage/lcov.info

11 changes: 9 additions & 2 deletions karma/karma-unit.tpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,22 @@ module.exports = function (config) {
require('../node_modules/karma-chrome-launcher'),
'karma-phantomjs-launcher',
/*require('../node_modules/karma-phantomjs-launcher'),*/
'karma-coverage',
],
preprocessors: {
'**/*.coffee': 'coffee'
'src/**/!(*.spec)+(.js)': 'coverage'
//'**/src/**[!spec].*.js': 'coverage'
},

/**
* How to report, by default. 'dots', 'progress'
*/
reporters: ['dots'],
reporters: ['dots', 'coverage'],

coverageReporter: {
type : 'lcov',
dir : 'coverage/'
},

/**
* On which port should the browser connect, on which port is the test runner
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"lodash": "~2.4.1",
"karma-phantomjs-launcher": "~0.1.1",
"karma-jasmine": "~0.2.x",
"karma-firefox-launcher": "~0.1.3"
"karma-firefox-launcher": "~0.1.3",
"karma-coverage": "~0.1"
},
"private": true
}

0 comments on commit 9cb5531

Please sign in to comment.