We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a6f2df6 commit 6a1879bCopy full SHA for 6a1879b
1 file changed
packages/driver/cypress/e2e/commands/files.cy.js
@@ -92,20 +92,19 @@ describe('src/cy/commands/files', () => {
92
93
err.code = 'ENOENT'
94
95
- let retries = 0
96
-
97
- cy.on('command:retry', () => {
98
- retries += 1
99
- })
100
101
Cypress.backend.withArgs('run:privileged')
102
.onFirstCall()
103
.rejects(err)
104
.onSecondCall()
105
.resolves(okResponse)
106
107
cy.readFile('foo.json').then(() => {
108
- expect(retries).to.eq(2)
+ // Verify two calls were indeed made: the first one to fail, and the second one to succeed.
+ const readFilePrivilegedCalls = Cypress.backend.getCalls().filter(
+ (c) => c.args[0] === 'run:privileged' && c.args[1]?.commandName === 'readFile',
+ )
+
+ expect(readFilePrivilegedCalls.length).to.eq(2)
109
})
110
111
0 commit comments