fix(types): cy.wait yields previous subject (#7682)

This commit is contained in:
Zach Bloomquist
2020-06-12 03:08:02 -04:00
committed by GitHub
parent fe7937c197
commit d3acf91ea6
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -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.
*
+4
View File
@@ -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; }[]