add options argument to cy.contains TS definition (#4756)

This commit is contained in:
Gleb Bahmutov
2019-07-19 10:15:50 -04:00
committed by GitHub
parent 456741b943
commit dd81ca5e3e
2 changed files with 12 additions and 2 deletions
+3 -1
View File
@@ -573,8 +573,10 @@ declare namespace Cypress {
* cy.contains(/^b\w+/)
* // yields <ul>...</ul>
* cy.contains('ul', 'apples')
* // tries to find the given text for up to 1 second
* cy.contains('my text to find', {timeout: 1000})
*/
contains(content: string | number | RegExp): Chainable<Subject>
contains(content: string | number | RegExp, options?: Partial<Loggable & Timeoutable>): Chainable<Subject>
/**
* Get the child DOM element that contains given text.
*
+9 -1
View File
@@ -191,7 +191,7 @@ cy.wrap([{ foo: 'bar' }, { foo: 'baz' }])
})
})
cy.get('something').should('have.length', 1)
cy.get('something').should('have.length', 1)
cy.stub().withArgs('').log(false).as('foo')
@@ -297,3 +297,11 @@ namespace CypressTriggerTests {
const now = new Date(2019, 3, 2).getTime()
cy.clock(now, ['Date'])
namespace CypressContainsTests {
cy.contains('#app')
cy.contains('my text to find')
cy.contains('#app', 'my text to find')
cy.contains('#app', 'my text to find', {log: false, timeout: 100})
cy.contains('my text to find', {log: false, timeout: 100})
}