Skip to content

Commit 885541e

Browse files
committed
improve error messages for unsupported APIs/commands
1 parent f164404 commit 885541e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

packages/driver/cypress/integration/e2e/multi-domain/commands/multi_domain_unsupported_commands.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ context('cy.origin unsupported commands', () => {
66

77
it('cy.route() method is deprecated', (done) => {
88
cy.on('fail', (err) => {
9-
expect(err.message).to.equal('`cy.route()` has been deprecated and use is not supported in the `cy.origin()` callback. Consider using `cy.intercept()` (outside of the callback) instead.')
9+
expect(err.message).to.equal('`cy.route()` has been deprecated and its use is not supported in the `cy.origin()` callback. Consider using `cy.intercept()` (outside of the callback) instead.')
1010
expect(err.docsUrl).to.equal('https://on.cypress.io/intercept')
1111
done()
1212
})
@@ -18,7 +18,7 @@ context('cy.origin unsupported commands', () => {
1818

1919
it('cy.server() method is deprecated', (done) => {
2020
cy.on('fail', (err) => {
21-
expect(err.message).to.equal('`cy.server()` has been deprecated and use is not supported in the `cy.origin()` callback. Consider using `cy.intercept()` (outside of the callback) instead.')
21+
expect(err.message).to.equal('`cy.server()` has been deprecated and its use is not supported in the `cy.origin()` callback. Consider using `cy.intercept()` (outside of the callback) instead.')
2222
expect(err.docsUrl).to.equal('https://on.cypress.io/intercept')
2323
done()
2424
})

packages/driver/cypress/integration/e2e/multi-domain/multi_domain_cypress_api.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ describe('cy.origin Cypress API', () => {
206206
context('not supported', () => {
207207
it('throws an error when a user attempts to configure Cypress.Server.defaults() inside of cy.origin', (done) => {
208208
cy.on('fail', (err) => {
209-
expect(err.message).to.equal('`Cypress.Server.*` has been deprecated and use is not supported in the `cy.origin()` callback. Consider using `cy.intercept()` (outside of the callback) instead.')
209+
expect(err.message).to.equal('`Cypress.Server.*` has been deprecated and its use is not supported in the `cy.origin()` callback. Consider using `cy.intercept()` (outside of the callback) instead.')
210210
expect(err.docsUrl).to.equal('https://on.cypress.io/intercept')
211211
done()
212212
})

packages/driver/src/cypress/error_messages.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,15 +1205,15 @@ export default {
12051205
},
12061206
unsupported: {
12071207
route: {
1208-
message: `${cmd('route')} has been deprecated and use is not supported in the ${cmd('origin')} callback. Consider using ${cmd('intercept')} (outside of the callback) instead.`,
1208+
message: `${cmd('route')} has been deprecated and its use is not supported in the ${cmd('origin')} callback. Consider using ${cmd('intercept')} (outside of the callback) instead.`,
12091209
docsUrl: 'https://on.cypress.io/intercept',
12101210
},
12111211
server: {
1212-
message: `${cmd('server')} has been deprecated and use is not supported in the ${cmd('origin')} callback. Consider using ${cmd('intercept')} (outside of the callback) instead.`,
1212+
message: `${cmd('server')} has been deprecated and its use is not supported in the ${cmd('origin')} callback. Consider using ${cmd('intercept')} (outside of the callback) instead.`,
12131213
docsUrl: 'https://on.cypress.io/intercept',
12141214
},
12151215
Server: {
1216-
message: `\`Cypress.Server.*\` has been deprecated and use is not supported in the ${cmd('origin')} callback. Consider using ${cmd('intercept')} (outside of the callback) instead.`,
1216+
message: `\`Cypress.Server.*\` has been deprecated and its use is not supported in the ${cmd('origin')} callback. Consider using ${cmd('intercept')} (outside of the callback) instead.`,
12171217
docsUrl: 'https://on.cypress.io/intercept',
12181218
},
12191219
Cookies_preserveOnce: {

0 commit comments

Comments
 (0)