Skip to content

Commit

Permalink
Update types to support promises in wrap (#2807)
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Sachs authored and brian-mann committed Dec 3, 2018
1 parent d57ca55 commit ca1139a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cli/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1568,6 +1568,16 @@ declare namespace Cypress {
* })
*/
wrap<E extends Node = HTMLElement>(element: E | JQuery<E>, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
/**
* Yield the element passed into `.wrap()` to the next command in the Cypress chain.
*
* @see https://on.cypress.io/wrap
* @example
* cy.wrap(new Promise((resolve, reject) => {
* setTimeout(resolve, 1000);
* }).then(result => {})
*/
wrap<F extends Promise<S>, S>(promise: F, options?: Partial<Loggable & Timeoutable>): Chainable<S>
/**
* Yields whatever is passed into `.wrap()` to the next command in the Cypress chain.
*
Expand Down

0 comments on commit ca1139a

Please sign in to comment.