Update types to support promises in wrap (#2807)

This commit is contained in:
Paul Sachs
2018-12-02 21:04:42 -05:00
committed by Brian Mann
parent d57ca55749
commit ca1139a092
+10
View File
@@ -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.
*