Skip to content

TypeScript: invoke doesn't see jQuery methods #58

@aaronmcadam

Description

@aaronmcadam

Using invoke raises an error when trying to use jQuery methods.

Here's an example:

cy.getByTestId('input')
  .invoke(
    'data',
    'isactive',
  )
  .should('eq', true);

This is the error:

Argument of type '"data"' is not assignable to parameter of type '"dir" | "slot" | "style" | "title" | "accessKey" | "accessKeyLabel" | "autocapitalize" | "draggable" | "hidden" | "innerText" | "lang" | "offsetHeight" | "offsetLeft" | "offsetParent" | ... 227 more ... | "focus"'.

It appears the return type of getByTestId is still evaluating to HTMLElement.

I'll look into this when I get time.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingreleased

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions