Skip to content

Commit

Permalink
fix: update custom-query on links to match custom-command syntax (#25092
Browse files Browse the repository at this point in the history
)
  • Loading branch information
emilyrohrbough authored and flotwig committed Dec 13, 2022
1 parent 3dbe730 commit 0099649
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cli/types/cypress.d.ts
Expand Up @@ -362,7 +362,7 @@ declare namespace Cypress {

/**
* Utility functions for ensuring various properties about a subject.
* @see https://on.cypress.io/custom-queries
* @see https://on.cypress.io/api/custom-queries
*/
ensure: Ensure

Expand Down Expand Up @@ -1613,7 +1613,7 @@ declare namespace Cypress {
/**
* Invoke a command synchronously, without using the command queue.
*
* @see https://on.cypress.io/custom-queries
* @see https://on.cypress.io/api/custom-queries
*/
now(name: string, ...args: any[]): Promise<any> | ((subject: any) => any)

Expand Down
4 changes: 2 additions & 2 deletions packages/driver/cypress/e2e/commands/commands.cy.js
Expand Up @@ -91,7 +91,7 @@ describe('src/cy/commands/commands', () => {
it('throws when attempting to add an existing query', (done) => {
cy.on('fail', (err) => {
expect(err.message).to.eq('`Cypress.Commands.addQuery()` is used to create new queries, but `get` is an existing Cypress command or query, or is reserved internally by Cypress.\n\n If you want to override an existing command or query, use `Cypress.Commands.overrideQuery()` instead.')
expect(err.docsUrl).to.eq('https://on.cypress.io/custom-queries')
expect(err.docsUrl).to.eq('https://on.cypress.io/api/custom-queries')

done()
})
Expand Down Expand Up @@ -139,7 +139,7 @@ describe('src/cy/commands/commands', () => {
it('throws when attempting to add a query with the same name as an internal function', (done) => {
cy.on('fail', (err) => {
expect(err.message).to.eq('`Cypress.Commands.addQuery()` cannot create a new query named `addCommand` because that name is reserved internally by Cypress.')
expect(err.docsUrl).to.eq('https://on.cypress.io/custom-queries')
expect(err.docsUrl).to.eq('https://on.cypress.io/api/custom-queries')

done()
})
Expand Down
4 changes: 2 additions & 2 deletions packages/driver/src/cypress/error_messages.ts
Expand Up @@ -853,11 +853,11 @@ export default {
},
invalid_new_query: {
message: '`Cypress.Commands.addQuery()` is used to create new queries, but `{{name}}` is an existing Cypress command or query, or is reserved internally by Cypress.\n\n If you want to override an existing command or query, use `Cypress.Commands.overrideQuery()` instead.',
docsUrl: 'https://on.cypress.io/custom-queries',
docsUrl: 'https://on.cypress.io/api/custom-queries',
},
reserved_command_query: {
message: '`Cypress.Commands.addQuery()` cannot create a new query named `{{name}}` because that name is reserved internally by Cypress.',
docsUrl: 'https://on.cypress.io/custom-queries',
docsUrl: 'https://on.cypress.io/api/custom-queries',
},
invalid_overwrite: {
message: 'Cannot overwite command for: `{{name}}`. An existing command does not exist by that name.',
Expand Down

0 comments on commit 0099649

Please sign in to comment.