Skip to content

Commit

Permalink
test: add global type for inferring type on cy.wrap
Browse files Browse the repository at this point in the history
  • Loading branch information
g-saracca committed Sep 9, 2024
1 parent 772bf41 commit d8986a9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ import { BASE_URL } from '../../src/config'

ApiConfig.init(`${BASE_URL}/api/v1`, DataverseApiAuthMechanism.SESSION_COOKIE)

//https://github.com/cypress-io/cypress/issues/18182
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace Cypress {
interface Chainable {
wrap<E extends Node = HTMLElement>(
element: E | JQuery<E>,
options?: Partial<Loggable & Timeoutable>
): Chainable<JQuery<E>>
wrap<S>(object: S | Promise<S>, options?: Partial<Loggable & Timeoutable>): Chainable<S>
}
}
}

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import registerCypressGrep from '@cypress/grep'
Expand Down

0 comments on commit d8986a9

Please sign in to comment.