Skip to content

Commit

Permalink
fix(types): cy.wait yields previous subject
Browse files Browse the repository at this point in the history
  • Loading branch information
flotwig committed Jun 11, 2020
1 parent 0e545f9 commit ce2e0aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cli/types/cypress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
4 changes: 4 additions & 0 deletions cli/types/tests/cypress-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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; }[]
Expand Down

0 comments on commit ce2e0aa

Please sign in to comment.