From ca1139a09220c4e577c7442759ffa5694a43eaf2 Mon Sep 17 00:00:00 2001 From: Paul Sachs Date: Sun, 2 Dec 2018 21:04:42 -0500 Subject: [PATCH] Update types to support promises in wrap (#2807) --- cli/types/index.d.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cli/types/index.d.ts b/cli/types/index.d.ts index 92cde69ee78d..1d2c9ac5a2ca 100644 --- a/cli/types/index.d.ts +++ b/cli/types/index.d.ts @@ -1568,6 +1568,16 @@ declare namespace Cypress { * }) */ wrap(element: E | JQuery, options?: Partial): Chainable> + /** + * 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, S>(promise: F, options?: Partial): Chainable /** * Yields whatever is passed into `.wrap()` to the next command in the Cypress chain. *