mirror of
https://github.com/cypress-io/cypress.git
synced 2026-02-19 21:51:16 -06:00
* server: fixes #977, capture stdout in windows * driver: skip flaky tests for now * root: fix breaking eslint due to 4.14.0 * cli: bump xvfb to make node4 happy * cli: bump xvfb fix context
38 lines
725 B
CoffeeScript
38 lines
725 B
CoffeeScript
_write = process.stdout.write
|
|
_log = process.log
|
|
|
|
module.exports = {
|
|
capture: ->
|
|
logs = []
|
|
|
|
## lazily backup write to enable
|
|
## injection
|
|
write = process.stdout.write
|
|
log = process.log
|
|
|
|
## electron adds a new process.log
|
|
## method for windows instead of process.stdout.write
|
|
## https://github.com/cypress-io/cypress/issues/977
|
|
if log
|
|
process.log = (str) ->
|
|
logs.push(str)
|
|
|
|
log.apply(@, arguments)
|
|
|
|
process.stdout.write = (str) ->
|
|
logs.push(str)
|
|
|
|
write.apply(@, arguments)
|
|
|
|
return {
|
|
toString: -> logs.join("")
|
|
|
|
data: logs
|
|
}
|
|
|
|
restore: ->
|
|
## restore to the originals
|
|
process.stdout.write = _write
|
|
process.log = _log
|
|
}
|