domasx2 / testing-library-selector

reusable selectors for @testing-library
MIT License
41 stars 5 forks source link

Sharing selectors between tests #4

Closed davidkean closed 1 year ago

davidkean commented 1 year ago

I'd like to share my defined selectors between multiple files. I can do this by exporting from another test file but this feels strange. If I export from a regular ts file then it wants me to add the library to my regular dependencies, which I can use lint rules to ignore since they will only be consumed by tests, however this feels incorrect as well.

Is there a preferred or correct way to have a file that exports my defined selectors for reuse?