mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-23 08:50:20 -05:00
fix(types): cy.wait yields previous subject (#7682)
This commit is contained in:
Vendored
+1
-1
@@ -1942,7 +1942,7 @@ declare namespace Cypress {
|
||||
* @example
|
||||
* cy.wait(1000) // wait for 1 second
|
||||
*/
|
||||
wait(ms: number, options?: Partial<Loggable & Timeoutable>): Chainable<undefined>
|
||||
wait(ms: number, options?: Partial<Loggable & Timeoutable>): Chainable<Subject>
|
||||
/**
|
||||
* Wait for a specific XHR to respond.
|
||||
*
|
||||
|
||||
@@ -215,6 +215,10 @@ cy.wait(['@foo', '@bar'])
|
||||
first // $ExpectType WaitXHR
|
||||
})
|
||||
|
||||
cy.wait(1234) // $ExpectType Chainable<undefined>
|
||||
|
||||
cy.wrap('foo').wait(1234) // $ExpectType Chainable<string>
|
||||
|
||||
cy.wrap([{ foo: 'bar' }, { foo: 'baz' }])
|
||||
.then(subject => {
|
||||
subject // $ExpectType { foo: string; }[]
|
||||
|
||||
Reference in New Issue
Block a user