Skip to content

Commit

Permalink
fix forceNetworkError flake
Browse files Browse the repository at this point in the history
  • Loading branch information
flotwig committed Sep 20, 2021
1 parent 4854597 commit d263d2d
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ describe('Proxy Logging', () => {
})
})

it('works with forceNetworkError', () => {
it('works with forceNetworkError', { retries: 0 }, () => {
const logs: any[] = []

cy.on('log:added', (log) => {
Expand All @@ -230,15 +230,15 @@ describe('Proxy Logging', () => {
}
})

cy.intercept('/foo', { forceNetworkError: true }).as('alias')
cy.intercept('/foo*', { forceNetworkError: true }).as('alias')
.then(() => {
return fetch('/foo')
return fetch(`/foo?${Date.now()}`)
.catch(() => {})
})
.wrap(logs)
.should((logs) => {
// retries...
expect(logs).to.have.length.greaterThan(2)
expect(logs).to.have.length.greaterThan(0)

for (const log of logs) {
expect(log.err).to.include({ name: 'Error' })
Expand Down

0 comments on commit d263d2d

Please sign in to comment.