Skip to content

Commit

Permalink
Other: Updated travis to pipe to codeclimate, coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Mar 4, 2017
1 parent a7ab103 commit e70fbe3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ ratings:
- "lib/path/**.js"
- "lib/pool/**.js"
- "lib/utf8/**.js"
exclude_paths:
exclude_paths:
- "**/tests/**"
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ matrix:
- node_js: 6
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
- node_js: 6
script: npm install coveralls@^2.11.15; npm run coverage-ci
script: npm install coveralls@^2.11.15 codeclimate-test-reporter@^0.4.1; npm run coverage-ci
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"build": "gulp",
"changelog": "node scripts/changelog -w",
"coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js tests/node/*.js",
"coverage-ci": "npm run coverage && cat coverage/lcov.info | coveralls",
"coverage-ci": "npm run coverage && coveralls < coverage/lcov.info && codeclimate-test-reporter < coverage/lcov.info",
"docs": "jsdoc -c jsdoc.docs.json -R README.md --verbose --pedantic",
"lint": "eslint **/*.js",
"pages": "node scripts/pages",
Expand Down
1 change: 1 addition & 0 deletions src/reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ var create_array = typeof Uint8Array !== "undefined"
return new Reader(buffer);
throw Error("illegal buffer");
}
/* istanbul ignore next */
: function create_array(buffer) {
if (Array.isArray(buffer))
return new Reader(buffer);
Expand Down
8 changes: 8 additions & 0 deletions tests/api_writer-reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ var Writer = protobuf.Writer,

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

test.throws(function() {
Reader.create(1);
}, "should throw when creating a Reader from something else than a buffer");

test.doesNotThrow(function() {
Reader.create([]);
}, "should not throw when creating a Reader from an array (comp)");

// uint32, int32, sint32

var values = [
Expand Down

0 comments on commit e70fbe3

Please sign in to comment.