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:
reexport ByRoleMatcher from @testing-library/cypress
mark @testing-library/dom as a peer dependency (I'm not sure if it would fix it)
inform TypeScript users that they should also npm/yarn/pnpm install -D @testing-library/dom to have access to all of the types
cypress-testing-library
version: 8.0.7node
version: v18.12.1pnpm
version: 7.16.1My package.json
I wanted to import
ByRoleMatcher
type from@testing-library/cypress
, since this type is used as an argument type forfindByRole(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:
ByRoleMatcher
from@testing-library/cypress
@testing-library/dom
as a peer dependency (I'm not sure if it would fix it)npm/yarn/pnpm install -D @testing-library/dom
to have access to all of the types