Skip to content

Commit d7ffd13

Browse files
committed
Analice tests coverture
1 parent d68c5d9 commit d7ffd13

File tree

4 files changed

+35
-1
lines changed

4 files changed

+35
-1
lines changed

.travis.yml

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

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# post2sse
22
POST to Server Send Events proxy
3+
4+
[![Coverage Status](https://coveralls.io/repos/piranna/post2sse/badge.svg?branch=master&service=github)](https://coveralls.io/github/piranna/post2sse?branch=master)

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"description": "POST to Server Send Events proxy",
55
"main": "index.js",
66
"scripts": {
7-
"test": "mocha"
7+
"test": "mocha",
8+
"coveralls": "scripts/coveralls"
89
},
910
"repository": {
1011
"type": "git",
@@ -31,7 +32,10 @@
3132
"sse": "^0.0.6"
3233
},
3334
"devDependencies": {
35+
"coveralls": "^2.11.6",
36+
"jscoverage": "piranna/jscoverage",
3437
"mocha": "^2.3.4",
38+
"mocha-lcov-reporter": "^1.0.0",
3539
"supertest": "^1.1.0",
3640
"suppose": "^0.4.0"
3741
}

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)