Skip to content

Commit

Permalink
add test to verify errors form cross domain done function are being s…
Browse files Browse the repository at this point in the history
…ent back to the primary domain
  • Loading branch information
AtofStryker committed Jan 3, 2022
1 parent 9895be6 commit fa11d5e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/driver/cypress/integration/e2e/multidomain_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,5 +163,22 @@ describe('multidomain', { experimentalSessionSupport: true }, () => {
})
})
})

// TODO: Proper stack trace printing still needs to be addressed here
it('propagates secondary domain errors to the primary that occur within the test', () => {
return new Promise((resolve) => {
cy.on('fail', (e) => {
expect(e.message).to.equal('done is not defined')
resolve(undefined)
})

// @ts-ignore
cy.switchToDomain('foobar.com', () => {
// done is not defined on purpose here as we want to test the error gets sent back to the primary domain correctly
// @ts-ignore
done()
})
})
})
})
})

0 comments on commit fa11d5e

Please sign in to comment.