Skip to content

Commit f4c2211

Browse files
committed
Revert "secure cookie error crash (cypress-io#2685)"
This reverts commit 2333d04.
1 parent 6bb8250 commit f4c2211

File tree

240 files changed

+2894
-4848
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

240 files changed

+2894
-4848
lines changed

.eslintrc

-59
Original file line numberDiff line numberDiff line change
@@ -2,67 +2,8 @@
22
"extends": [
33
"plugin:cypress-dev/general"
44
],
5-
"rules": {
6-
"no-multiple-empty-lines": ["error", { "max": 1 } ],
7-
"no-else-return": [ "error", { "allowElseIf": false } ],
8-
"brace-style": ["error", "1tbs", { "allowSingleLine": false }],
9-
"no-unneeded-ternary": ["error"],
10-
"array-bracket-newline": ["error", "consistent"],
11-
"arrow-body-style": ["error", "always"],
12-
"padding-line-between-statements": [
13-
"error",
14-
{
15-
"blankLine": "always",
16-
"prev": "*",
17-
"next": "return"
18-
},
19-
{
20-
"blankLine": "always",
21-
"prev": [
22-
"const",
23-
"let",
24-
"var",
25-
"if",
26-
"while",
27-
"export",
28-
"cjs-export",
29-
"import",
30-
"cjs-import"
31-
],
32-
"next": "*"
33-
},
34-
{
35-
"blankLine": "any",
36-
"prev": [
37-
"const",
38-
"let",
39-
"var",
40-
"import",
41-
"cjs-import"
42-
],
43-
"next": [
44-
"const",
45-
"let",
46-
"var",
47-
"import",
48-
"cjs-import"
49-
]
50-
}
51-
]
52-
},
535
"env": {
546
"es6": true,
557
"node": true
56-
},
57-
"parserOptions": {
58-
"ecmaFeatures": {
59-
"legacyDecorators": true
60-
}
61-
},
62-
"overrides": {
63-
"files": ["**/*.jsx"],
64-
"rules": {
65-
"arrow-body-style": "off",
66-
}
678
}
689
}

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ dist
88
dist-*
99
build
1010
.history
11+
.vscode
1112
.publish
1213
_test-output
1314
cypress.zip
1415
tmp/
1516
.nyc_output
16-
.vscode/settings.json
1717

1818
# from extension
1919
Cached Theme.pak

.vscode/launch.json

-32
This file was deleted.

.vscode/tasks.json

-29
This file was deleted.

.vscode/terminals.json

-56
This file was deleted.

bulk-decaffeinate.config.js

-17
This file was deleted.

cli/lib/cli.js

-8
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const cache = require('./tasks/cache')
1010
// we want to print help for the current command and exit with an error
1111
function unknownOption (flag, type = 'option') {
1212
if (this._allowUnknownOption) return
13-
1413
logger.error()
1514
logger.error(` error: unknown ${type}:`, flag)
1615
logger.error()
@@ -88,7 +87,6 @@ function includesVersion (args) {
8887

8988
function showVersions () {
9089
debug('printing Cypress version')
91-
9290
return require('./exec/versions')
9391
.getVersions()
9492
.then((versions = {}) => {
@@ -189,7 +187,6 @@ module.exports = {
189187
const defaultOpts = { force: true, welcomeMessage: false }
190188
const parsedOpts = parseOpts(opts)
191189
const options = _.extend(parsedOpts, defaultOpts)
192-
193190
require('./tasks/verify')
194191
.start(options)
195192
.catch(util.logErrorExit1)
@@ -206,7 +203,6 @@ module.exports = {
206203
if (opts.command || !_.includes(['list', 'path', 'clear'], opts)) {
207204
unknownOption.call(this, `cache ${opts}`, 'sub-command')
208205
}
209-
210206
cache[opts]()
211207
})
212208

@@ -223,12 +219,10 @@ module.exports = {
223219
// Deprecated Catches
224220

225221
const firstCommand = args[2]
226-
227222
if (!_.includes(knownCommands, firstCommand)) {
228223
debug('unknown command %s', firstCommand)
229224
logger.error('Unknown command', `"${firstCommand}"`)
230225
program.outputHelp()
231-
232226
return util.exit(1)
233227
}
234228

@@ -239,9 +233,7 @@ module.exports = {
239233
// so we have to manually catch '-v, --version'
240234
return showVersions()
241235
}
242-
243236
debug('program parsing arguments')
244-
245237
return program.parse(args)
246238
},
247239
}

cli/lib/cypress.js

-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const util = require('./util')
1111
const cypressModuleApi = {
1212
open (options = {}) {
1313
options = util.normalizeModuleOptions(options)
14-
1514
return open.start(options)
1615
},
1716

@@ -32,7 +31,6 @@ const cypressModuleApi = {
3231
message: 'Could not find Cypress test run results',
3332
}
3433
}
35-
3634
return output
3735
})
3836
})

cli/lib/errors.js

+19-32
Original file line numberDiff line numberDiff line change
@@ -25,33 +25,29 @@ const failedUnzip = {
2525
`,
2626
}
2727

28-
const missingApp = (binaryDir) => {
29-
return {
30-
description: `No version of Cypress is installed in: ${chalk.cyan(binaryDir)}`,
31-
solution: stripIndent`
28+
const missingApp = (binaryDir) => ({
29+
description: `No version of Cypress is installed in: ${chalk.cyan(binaryDir)}`,
30+
solution: stripIndent`
3231
\nPlease reinstall Cypress by running: ${chalk.cyan('cypress install')}
3332
`,
34-
}
35-
}
33+
})
3634

37-
const binaryNotExecutable = (executable) => {
38-
return {
39-
description: `Cypress cannot run because the binary does not have executable permissions: ${executable}`,
40-
solution: stripIndent`\n
35+
const binaryNotExecutable = (executable) => ({
36+
description: `Cypress cannot run because the binary does not have executable permissions: ${executable}`,
37+
solution: stripIndent`\n
4138
Reasons this may happen:
4239
4340
- node was installed as 'root' or with 'sudo'
4441
- the cypress npm package as 'root' or with 'sudo'
4542
4643
Please check that you have the appropriate user permissions.
4744
`,
48-
}
49-
}
45+
})
46+
5047

51-
const notInstalledCI = (executable) => {
52-
return {
53-
description: 'The cypress npm package is installed, but the Cypress binary is missing.',
54-
solution: stripIndent`\n
48+
const notInstalledCI = (executable) => ({
49+
description: 'The cypress npm package is installed, but the Cypress binary is missing.',
50+
solution: stripIndent`\n
5551
We expected the binary to be installed here: ${chalk.cyan(executable)}
5652
5753
Reasons it may be missing:
@@ -65,8 +61,7 @@ const notInstalledCI = (executable) => {
6561
6662
${chalk.blue('https://on.cypress.io/not-installed-ci-error')}
6763
`,
68-
}
69-
}
64+
})
7065

7166
const nonZeroExitCodeXvfb = {
7267
description: 'XVFB exited with a non zero exit code.',
@@ -151,7 +146,6 @@ const removed = {
151146
const CYPRESS_RUN_BINARY = {
152147
notValid: (value) => {
153148
const properFormat = `**/${state.getPlatformExecutable()}`
154-
155149
return {
156150
description: `Could not run binary set by environment variable CYPRESS_RUN_BINARY=${value}`,
157151
solution: `Ensure the environment variable is a path to the Cypress binary, matching ${properFormat}`,
@@ -161,19 +155,15 @@ const CYPRESS_RUN_BINARY = {
161155

162156
function getPlatformInfo () {
163157
return util.getOsVersionAsync()
164-
.then((version) => {
165-
return stripIndent`
158+
.then((version) => stripIndent`
166159
Platform: ${os.platform()} (${version})
167160
Cypress Version: ${util.pkgVersion()}
168-
`
169-
})
161+
`)
170162
}
171163

172164
function addPlatformInformation (info) {
173165
return getPlatformInfo()
174-
.then((platform) => {
175-
return merge(info, { platform })
176-
})
166+
.then((platform) => merge(info, { platform }))
177167
}
178168

179169
function formErrorText (info, msg) {
@@ -226,16 +216,13 @@ function formErrorText (info, msg) {
226216

227217
const raise = (text) => {
228218
const err = new Error(text)
229-
230219
err.known = true
231220
throw err
232221
}
233222

234-
const throwFormErrorText = (info) => {
235-
return (msg) => {
236-
return formErrorText(info, msg)
237-
.then(raise)
238-
}
223+
const throwFormErrorText = (info) => (msg) => {
224+
return formErrorText(info, msg)
225+
.then(raise)
239226
}
240227

241228
module.exports = {

0 commit comments

Comments
 (0)