Skip to content

Why does TS stops me from defining my own type when using alias? "TS2769: No overload matches this call" #9525

Discussion options

You must be logged in to vote

Answer:

    cy.get<Customer>('@customer').then((customer: Customer) => {
      assert.isDefined(customer.ref);
    });

get allows a dynamic type. See:

get<E extends Node = HTMLElement>(selector: string, options?: Partial<Loggable & Timeoutable & Withinable & Shadow>): Chainable<JQuery<E>>

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Vadorequest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant