Skip to content

Commit

Permalink
improve error messages for unsupported APIs/commands
Browse files Browse the repository at this point in the history
  • Loading branch information
AtofStryker committed Apr 22, 2022
1 parent f164404 commit 885541e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Expand Up @@ -6,7 +6,7 @@ context('cy.origin unsupported commands', () => {

it('cy.route() method is deprecated', (done) => {
cy.on('fail', (err) => {
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.')
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.')
expect(err.docsUrl).to.equal('https://on.cypress.io/intercept')
done()
})
Expand All @@ -18,7 +18,7 @@ context('cy.origin unsupported commands', () => {

it('cy.server() method is deprecated', (done) => {
cy.on('fail', (err) => {
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.')
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.')
expect(err.docsUrl).to.equal('https://on.cypress.io/intercept')
done()
})
Expand Down
Expand Up @@ -206,7 +206,7 @@ describe('cy.origin Cypress API', () => {
context('not supported', () => {
it('throws an error when a user attempts to configure Cypress.Server.defaults() inside of cy.origin', (done) => {
cy.on('fail', (err) => {
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.')
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.')
expect(err.docsUrl).to.equal('https://on.cypress.io/intercept')
done()
})
Expand Down
6 changes: 3 additions & 3 deletions packages/driver/src/cypress/error_messages.ts
Expand Up @@ -1205,15 +1205,15 @@ export default {
},
unsupported: {
route: {
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.`,
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.`,
docsUrl: 'https://on.cypress.io/intercept',
},
server: {
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.`,
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.`,
docsUrl: 'https://on.cypress.io/intercept',
},
Server: {
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.`,
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.`,
docsUrl: 'https://on.cypress.io/intercept',
},
Cookies_preserveOnce: {
Expand Down

3 comments on commit 885541e

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 885541e Apr 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/9.6.0/linux-x64/feature-multidomain-885541ea5e736dfd4dac1d3254025b55b367fa3e/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 885541e Apr 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/9.6.0/darwin-x64/feature-multidomain-885541ea5e736dfd4dac1d3254025b55b367fa3e/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 885541e Apr 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/9.6.0/win32-x64/feature-multidomain-885541ea5e736dfd4dac1d3254025b55b367fa3e/cypress.tgz

Please sign in to comment.