Skip to content

Commit b6a1bf3

Browse files
committed
chore: add Travis configuration (#1)
* chore: add Travis configuration * chore: standard nits
1 parent 6bde0c0 commit b6a1bf3

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

.travis.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
language: node_js
2+
3+
os:
4+
- linux
5+
- osx
6+
7+
after_success: npm run coverage
8+
9+
node_js:
10+
- "0.10"
11+
- "0.12"
12+
- "4"
13+
- "5"
14+
- "node"

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = function (blocking) {
2-
[process.stdout, process.stderr].forEach(function(stream){
2+
[process.stdout, process.stderr].forEach(function (stream) {
33
if (stream._handle && typeof stream._handle.setBlocking === 'function') {
44
stream._handle.setBlocking(blocking)
55
}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"description": "set blocking stdio and stderr ensuring that terminal output does not truncate",
55
"main": "index.js",
66
"scripts": {
7-
"test": "nyc mocha ./test/*.js"
7+
"pretest": "standard",
8+
"test": "nyc mocha ./test/*.js",
9+
"coverage": "nyc report --reporter=text-lcov | coveralls"
810
},
911
"repository": {
1012
"type": "git",
@@ -25,6 +27,7 @@
2527
"homepage": "https://github.com/yargs/set-blocking#readme",
2628
"devDependencies": {
2729
"chai": "^3.5.0",
30+
"coveralls": "^2.11.9",
2831
"mocha": "^2.4.5",
2932
"nyc": "^6.4.4",
3033
"standard": "^7.0.1",

test/test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
/* global describe, should */
1+
/* global describe, it */
22

33
var exec = require('child_process').exec
4-
var setBlocking = require('../')
54

65
require('chai').should()
76

@@ -17,6 +16,7 @@ describe('setBlocking', function () {
1716

1817
it('does not truncate text printed to stderr when process.exit() is called', function (done) {
1918
exec('./test/fixtures/yargs-497-stderr.js', function (err, stdout, stderr) {
19+
err.should.match(/Command failed/)
2020
stderr.should.match(/line 2999/)
2121
return done()
2222
})

0 commit comments

Comments
 (0)