Skip to content

Commit

Permalink
Revert "Issue 21316 windows node11 (#2699) (fixes #2667)"
Browse files Browse the repository at this point in the history
This reverts commit 54ce93b.
  • Loading branch information
kuceb committed Nov 28, 2018
1 parent 24e9315 commit d241651
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 51 deletions.
9 changes: 7 additions & 2 deletions cli/lib/exec/spawn.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const _ = require('lodash')
const os = require('os')
const cp = require('child_process')
const path = require('path')
const Promise = require('bluebird')
Expand All @@ -12,12 +13,16 @@ const { throwFormErrorText, errors } = require('../errors')
const isXlibOrLibudevRe = /^(?:Xlib|libudev)/
const isHighSierraWarningRe = /\*\*\* WARNING/

function isPlatform (platform) {
return os.platform() === platform
}

function needsStderrPiped (needsXvfb) {
return util.isPlatform('darwin') || (needsXvfb && util.isPlatform('linux'))
return isPlatform('darwin') || (needsXvfb && isPlatform('linux'))
}

function needsEverythingPipedDirectly () {
return util.isPlatform('win32')
return isPlatform('win32')
}

function getStdio (needsXvfb) {
Expand Down
18 changes: 0 additions & 18 deletions cli/lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const isInstalledGlobally = require('is-installed-globally')
const pkg = require(path.join(__dirname, '..', 'package.json'))
const logger = require('./logger')
const debug = require('debug')('cypress:cli')
const compareVersions = require('compare-versions')

const getosAsync = Promise.promisify(getos)

Expand Down Expand Up @@ -68,7 +67,6 @@ const util = {
.mapValues((value) => { // stringify to 1 or 0
return value ? '1' : '0'
})
.extend(util.getNode11WindowsFix()) // the value has to be falsy, '0' as a string not good enoughs
.value()
},

Expand All @@ -80,14 +78,6 @@ const util = {
}
},

getNode11WindowsFix () {
if (compareVersions(util.getNodeVersion(), 'v11') >= 0 && util.isPlatform('win32')) {
return {
windowsHide: false,
}
}
},

getEnvColors () {
const sc = util.supportsColor()

Expand All @@ -98,14 +88,6 @@ const util = {
}
},

getNodeVersion () {
return process.version
},

isPlatform (platform) {
return os.platform() === platform
},

isTty (fd) {
return tty.isatty(fd)
},
Expand Down
1 change: 0 additions & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
"check-more-types": "2.24.0",
"commander": "2.11.0",
"common-tags": "1.4.0",
"compare-versions": "3.4.0",
"debug": "3.1.0",
"execa": "0.10.0",
"executable": "4.1.1",
Expand Down
30 changes: 0 additions & 30 deletions cli/test/lib/util_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,36 +191,6 @@ describe('util', () => {
DEBUG_COLORS: '0',
})
})

context('.windowsHide', () => {
it('is false on windows with node 11', () => {
os.platform.returns('win32')
sinon.stub(process, 'version').value('v11.0.0')
expect(util.getEnvOverrides().windowsHide).to.be.false
})

it('is false on windows with node > 11', () => {
os.platform.returns('win32')
sinon.stub(process, 'version').value('v12.0.0')
expect(util.getEnvOverrides().windowsHide).to.be.false
})

it('is undefined on windows with node < 11', () => {
os.platform.returns('win32')
sinon.stub(process, 'version').value('v8.0.0')
expect(util.getEnvOverrides().windowsHide).to.be.undefined

os.platform.returns('win32')
sinon.stub(process, 'version').value('v10.0.0')
expect(util.getEnvOverrides().windowsHide).to.be.undefined
})

it('is undefined on non-windows with node 11', () => {
os.platform.returns('darwin')
sinon.stub(process, 'version').value('v11.0.0')
expect(util.getEnvOverrides().windowsHide).to.be.undefined
})
})
})

context('.getForceTty', () => {
Expand Down

0 comments on commit d241651

Please sign in to comment.