cypress-testing-library icon indicating copy to clipboard operation
cypress-testing-library copied to clipboard

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

Open egucciar opened this issue 1 year ago • 1 comments

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"
  ]
}

egucciar avatar Jan 23 '24 18:01 egucciar

I'm transferring this to the cypress-testing-library repo :)

MatanBobi avatar Jan 24 '24 10:01 MatanBobi