Skip to content

Commit 9866e2f

Browse files
committed
fix: changes from #19837 causing flake in e2e_cookies_spec
1 parent e218960 commit 9866e2f

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

cli/scripts/post-install.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,22 @@ const filesToUncomment = [
8585
'jquery/misc.d.ts',
8686
]
8787

88+
// Added to make the execution of the script idempotent,
89+
// currently if this is run twice, under certain circumstances,
90+
// it's possible to double un-comment and break the type definitions
91+
const marker = '// -- Cypress Patched Types --'
92+
8893
filesToUncomment.forEach((file) => {
8994
const filePath = join(__dirname, '../types', file)
90-
const str = fs.readFileSync(filePath).toString()
95+
const str = fs.readFileSync(filePath, 'utf8')
96+
97+
if (str.includes(marker)) {
98+
return
99+
}
91100

92101
const result = str.split('\n').map((line) => {
93102
return line.startsWith('// ') ? line.substring(3) : line
94103
}).join('\n')
95104

96-
fs.writeFileSync(filePath, result)
105+
fs.writeFileSync(filePath, [marker, result].join('\n\n'))
97106
})

packages/driver/src/cy/commands/navigation.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import debugFn from 'debug'
1313
const debug = debugFn('cypress:driver:navigation')
1414

1515
let id = null
16-
let previousDomainVisited: boolean = false
17-
let hasVisitedAboutBlank: boolean = false
18-
let currentlyVisitingAboutBlank: boolean = false
19-
let knownCommandCausedInstability: boolean = false
16+
let previousDomainVisited: boolean | null = null
17+
let hasVisitedAboutBlank: boolean | null = null
18+
let currentlyVisitingAboutBlank: boolean | null = null
19+
let knownCommandCausedInstability: boolean | null = null
2020

2121
const REQUEST_URL_OPTS = 'auth failOnStatusCode retryOnNetworkFailure retryOnStatusCodeFailure retryIntervals method body headers'
2222
.split(' ')

yarn.lock

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35559,7 +35559,7 @@ [email protected], shell-quote@^1.4.2, shell-quote@^1.6.1:
3555935559
resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.2.tgz#67a7d02c76c9da24f99d20808fcaded0e0e04be2"
3556035560
integrity sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg==
3556135561

35562-
35562+
[email protected], shelljs@^0.8.4:
3556335563
version "0.8.5"
3556435564
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.5.tgz#de055408d8361bed66c669d2f000538ced8ee20c"
3556535565
integrity sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==
@@ -35568,15 +35568,6 @@ [email protected]:
3556835568
interpret "^1.0.0"
3556935569
rechoir "^0.6.2"
3557035570

35571-
shelljs@^0.8.4:
35572-
version "0.8.4"
35573-
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2"
35574-
integrity sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==
35575-
dependencies:
35576-
glob "^7.0.0"
35577-
interpret "^1.0.0"
35578-
rechoir "^0.6.2"
35579-
3558035571
shellwords@^0.1.1:
3558135572
version "0.1.1"
3558235573
resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b"

0 commit comments

Comments
 (0)