Skip to content

TypeScript: Property 'removeListener' does not exist on type 'cy' #5228

@rdhelms

Description

@rdhelms

Current behavior:

image

Desired behavior:

cy.removeListener and cy.removeAllListeners should be typed, since they are usable as referenced here:
https://docs.cypress.io/api/events/catalog-of-events.html#Binding-to-Events

Steps to reproduce:

  1. Create any cypress project using TypeScript as documented here:
    https://docs.cypress.io/guides/tooling/typescript-support.html
  2. In an it() block in a *.ts spec file, type cy.removeListener()
  3. TS will show an error

Versions

cypress@3.4.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions