Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update custom-query on links to match custom-command syntax #25092

Merged
merged 1 commit into from Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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