Skip to content

Commit a315fbf

Browse files
committed
tests coverture
1 parent 3d667b4 commit a315fbf

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
language: node_js
2+
node_js:
3+
- "4.1"
4+
- "4.0"
5+
- "0.12"
6+
- "0.11"
7+
- "iojs"
8+
after_script:
9+
- npm run coveralls

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"description": "",
55
"main": "index.js",
66
"scripts": {
7-
"test": "mocha"
7+
"test": "mocha",
8+
"coveralls": "scripts/coveralls"
89
},
910
"keywords": [
1011
"Context Broker",
@@ -17,7 +18,10 @@
1718
],
1819
"license": "AGPL-3.0",
1920
"devDependencies": {
21+
"coveralls": "^2.11.6",
22+
"jscoverage": "piranna/jscoverage",
2023
"mocha": "^2.4.5",
24+
"mocha-lcov-reporter": "^1.0.0",
2125
"nock": "^7.0.2"
2226
},
2327
"dependencies": {

scripts/coveralls

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
3+
# Create instrumented library
4+
rm -f index-cov.js
5+
jscoverage index.js
6+
7+
# Replace index.js for instrumented one
8+
mv index.js index-orig.js
9+
mv index-cov.js index.js
10+
11+
# Run coveralls
12+
mocha -R mocha-lcov-reporter | coveralls
13+
14+
# Restore index.js
15+
rm -f index.js
16+
mv index-orig.js index.js

0 commit comments

Comments
 (0)