mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-26 17:08:10 -05:00
Update types to allow for alias 'key' for 'keys' with chai chainers (#7687)
This commit is contained in:
Vendored
+16
@@ -3073,6 +3073,22 @@ declare namespace Cypress {
|
||||
* @see https://on.cypress.io/assertions
|
||||
*/
|
||||
(chainer: 'equal', value: any): Chainable<Subject>
|
||||
/**
|
||||
* Causes all `.key` assertions that follow in the chain to require that the target have all of the given keys. This is the opposite of `.any`, which only requires that the target have at least one of the given keys.
|
||||
* @example
|
||||
* cy.wrap({ a: 1, b: 2 }).should('have.all.key', 'a', 'b')
|
||||
* @see http://chaijs.com/api/bdd/#method_all
|
||||
* @see https://on.cypress.io/assertions
|
||||
*/
|
||||
(chainer: 'have.all.key', ...value: string[]): Chainable<Subject>
|
||||
/**
|
||||
* Causes all `.key` assertions that follow in the chain to only require that the target have at least one of the given keys. This is the opposite of `.all`, which requires that the target have all of the given keys.
|
||||
* @example
|
||||
* cy.wrap({ a: 1, b: 2 }).should('have.any.key', 'a')
|
||||
* @see http://chaijs.com/api/bdd/#method_any
|
||||
* @see https://on.cypress.io/assertions
|
||||
*/
|
||||
(chainer: 'have.any.key', ...value: string[]): Chainable<Subject>
|
||||
/**
|
||||
* Causes all `.keys` assertions that follow in the chain to require that the target have all of the given keys. This is the opposite of `.any`, which only requires that the target have at least one of the given keys.
|
||||
* @example
|
||||
|
||||
@@ -88,6 +88,10 @@ cy.wrap({ a: 1, b: 2 }).should('have.all.keys', 'a', 'b')
|
||||
|
||||
cy.wrap({ a: 1, b: 2 }).should('have.any.keys', 'a')
|
||||
|
||||
cy.wrap({ a: 1, b: 2 }).should('have.all.key', 'a', 'b')
|
||||
|
||||
cy.wrap({ a: 1, b: 2 }).should('have.any.key', 'a')
|
||||
|
||||
cy.wrap({ x: {a: 1 }}).should('have.deep.property', 'x', { a: 1 })
|
||||
|
||||
cy.wrap([1, 2, 3]).should('have.length', 3)
|
||||
|
||||
Reference in New Issue
Block a user