Skip to content

Commit

Permalink
fix: more debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Apr 20, 2018
1 parent 78d565a commit 605d952
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions index.js
Expand Up @@ -15,7 +15,7 @@ function Xvfb(options) {
options = options || {}
this._display = options.displayNum ? `:${options.displayNum}` : null
this._reuse = options.reuse
this._timeout = options.timeout || 2000
this._timeout = options.timeout || options.timeOut || 2000
this._silent = options.silent
this._onStderrData = options.onStderrData || (() => {})
this._xvfb_args = options.xvfb_args || []
Expand Down Expand Up @@ -134,9 +134,11 @@ Xvfb.prototype = {
_setDisplayEnvVariable() {
this._oldDisplay = process.env.DISPLAY
process.env.DISPLAY = this.display()
debug('setting DISPLAY %s', process.env.DISPLAY)
},

_restoreDisplayEnvVariable() {
debug('restoring process.env.DISPLAY variable')
// https://github.com/cypress-io/xvfb/issues/1
// only reset truthy backed' up values
if (this._oldDisplay) {
Expand Down Expand Up @@ -210,7 +212,9 @@ Xvfb.prototype = {
this.display()
.toString()
.replace(/^:/, '')
return `/tmp/.X${displayNum}-lock`
const filename = `/tmp/.X${displayNum}-lock`
debug('lock filename %s', filename)
return filename
},
}

Expand Down

0 comments on commit 605d952

Please sign in to comment.