pipe streams and ignore stderr, close #557 (#560)

This commit is contained in:
Gleb Bahmutov
2017-10-04 20:39:25 +00:00
committed by GitHub
parent 720b78f9b0
commit a897e3690d
3 changed files with 12 additions and 1 deletions
+5 -1
View File
@@ -1,6 +1,7 @@
const _ = require('lodash')
const cp = require('child_process')
const Promise = require('bluebird')
const devNull = require('dev-null')
const debug = require('debug')('cypress:cli')
const info = require('../tasks/info')
@@ -13,7 +14,7 @@ module.exports = {
_.defaults(options, {
detached: false,
stdio: [process.stdin, process.stdout, 'ignore'],
stdio: ['inherit', 'pipe', 'pipe'],
})
const spawn = () => {
@@ -26,6 +27,9 @@ module.exports = {
child.on('close', resolve)
child.on('error', reject)
child.stdout.pipe(process.stdout)
child.stderr.pipe(devNull())
if (options.detached) {
child.unref()
}
+1
View File
@@ -30,6 +30,7 @@
"commander": "2.9.0",
"common-tags": "1.4.0",
"debug": "2.6.8",
"dev-null": "0.1.1",
"extract-zip": "1.6.5",
"fs-extra": "4.0.1",
"getos": "2.8.4",
+6
View File
@@ -12,6 +12,12 @@ describe('exec spawn', function () {
this.spawnedProcess = this.sandbox.stub({
on: () => {},
unref: () => {},
stdout: {
pipe: () => {},
},
stderr: {
pipe: () => {},
},
})
this.sandbox.stub(cp, 'spawn').returns(this.spawnedProcess)
this.sandbox.stub(xvfb, 'start').resolves()