testing-library / cypress-testing-library

🐅 Simple and complete custom Cypress commands and utilities that encourage good testing practices.
http://npm.im/@testing-library/cypress
MIT License
1.8k stars 152 forks source link

Cannot import `ByRoleMatcher` (and others) from @testing-library/cypress #242

Open srflp opened 1 year ago

srflp commented 1 year ago

My package.json

  "devDependencies": {
    "@faker-js/faker": "^7.6.0",
    "@testing-library/cypress": "^8.0.3",
    "@typescript-eslint/eslint-plugin": "^5.43.0",
    "@typescript-eslint/parser": "^5.43.0",
    "cypress": "^11.1.0",
    "eslint": "^8.27.0",
    "eslint-config-prettier": "^8.5.0",
    "eslint-plugin-cypress": "^2.12.1",
    "husky": "^8.0.2",
    "lint-staged": "^13.0.3",
    "prettier": "^2.7.1",
    "typescript": "~4.8.4"
  },
  "dependencies": {}

I wanted to import ByRoleMatcher type from @testing-library/cypress, since this type is used as an argument type for findByRole(id: ByRoleMatcher, options?: ByRoleOptions) function from @testing-library/cypress.

Problem:

ByRoleMatcher is used by @testing-library/cypress but is not exported by it. And I want to use this type in my project.

Suggested solutions: