Skip to content

Commit 81c2f58

Browse files
committed
Adding coverage
1 parent 2d8c06e commit 81c2f58

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

.travis.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
language: node_js
2+
23
node_js:
3-
- '4.2'
44
- 'stable'
5-
script: npm run test:single
5+
6+
script: npm test
7+
68
before_script:
7-
- npm install
9+
- npm install
10+
11+
after_success:
12+
- npm run codecov

karma.conf.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,13 @@ module.exports = function(config) {
8080

8181
// optionally, configure the reporter
8282
coverageReporter: {
83-
type : 'html',
84-
dir : 'coverage/'
83+
// specify a common output directory
84+
dir: 'coverage/',
85+
reporters: [
86+
// reporters not supporting the `file` property
87+
{ type: 'html', subdir: 'report-html' },
88+
{ type: 'lcov', subdir: 'report-lcov' }
89+
]
8590
}
8691
})
8792
}

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
},
3333
"devDependencies": {
3434
"browserify": "^13.0.0",
35+
"codecov.io": "^0.1.6",
3536
"gulp": "^3.9.1",
3637
"gulp-autoprefixer": "^3.1.0",
3738
"gulp-bump": "^1.0.0",
@@ -58,7 +59,8 @@
5859
"phantomjs-prebuilt": "^2.1.5"
5960
},
6061
"scripts": {
61-
"test": "karma start",
62-
"test:single": "./node_modules/.bin/karma start --single-run --browsers PhantomJS"
62+
"test": "karma start --single-run --browsers PhantomJS",
63+
"test:watch": "karma start",
64+
"codecov": "cat coverage/*/lcov.info | codecov"
6365
}
6466
}

0 commit comments

Comments
 (0)