Skip to content

Property 'findByTestId' does not exist on type 'cy & CyEventEmitter' - only in .cy.tsx (component testing) files #271

Description

@egucciar

Problem description:

I have cypress types working and configured in tsconfig.json, however, the type does not appear to work outside of the /cypress folder.

{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "types": [
      "cookie-session",
      "cypress",
      "node",
      "cypress-real-events",
      "cypress-wait-until",
      "@testing-library/cypress",
      "@cypress/grep",
      "webpack-env"
    ]
  },
  "exclude": ["**/*.test.tsx", "**/*.test.ts", "**/__tests__", "common/test-utils"],
  "include": [
    "./cypress.config.ts",
    "cypress",
    "**/*.cy.tsx",
    "**/*.d.ts",
    "webapp/src",
    "ui",
    "common",
    "./**/*.json",
    "webapp/Config.ts"
  ]
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions