Skip to content

Commit e70fbe3

Browse files
committed
Other: Updated travis to pipe to codeclimate, coverage
1 parent a7ab103 commit e70fbe3

File tree

5 files changed

+13
-3
lines changed

5 files changed

+13
-3
lines changed

.codeclimate.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ ratings:
1212
- "lib/path/**.js"
1313
- "lib/pool/**.js"
1414
- "lib/utf8/**.js"
15-
exclude_paths:
15+
exclude_paths:
16+
- "**/tests/**"

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ matrix:
2222
- node_js: 6
2323
script: set -e; if [ -n "$SAUCE_USERNAME" ]; then npm install zuul@^3.11.1 zuul-ngrok@^4.0.0; travis_wait npm run zuul; sleep 3; fi
2424
- node_js: 6
25-
script: npm install coveralls@^2.11.15; npm run coverage-ci
25+
script: npm install coveralls@^2.11.15 codeclimate-test-reporter@^0.4.1; npm run coverage-ci

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"build": "gulp",
2929
"changelog": "node scripts/changelog -w",
3030
"coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js tests/node/*.js",
31-
"coverage-ci": "npm run coverage && cat coverage/lcov.info | coveralls",
31+
"coverage-ci": "npm run coverage && coveralls < coverage/lcov.info && codeclimate-test-reporter < coverage/lcov.info",
3232
"docs": "jsdoc -c jsdoc.docs.json -R README.md --verbose --pedantic",
3333
"lint": "eslint **/*.js",
3434
"pages": "node scripts/pages",

src/reader.js

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ var create_array = typeof Uint8Array !== "undefined"
4646
return new Reader(buffer);
4747
throw Error("illegal buffer");
4848
}
49+
/* istanbul ignore next */
4950
: function create_array(buffer) {
5051
if (Array.isArray(buffer))
5152
return new Reader(buffer);

tests/api_writer-reader.js

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ var Writer = protobuf.Writer,
77

88
tape.test("writer & reader", function(test) {
99

10+
test.throws(function() {
11+
Reader.create(1);
12+
}, "should throw when creating a Reader from something else than a buffer");
13+
14+
test.doesNotThrow(function() {
15+
Reader.create([]);
16+
}, "should not throw when creating a Reader from an array (comp)");
17+
1018
// uint32, int32, sint32
1119

1220
var values = [

0 commit comments

Comments
 (0)