DEV Community

Discussion on: Build Reusable Testing Queries

Collapse
 
frenkix profile image
Goran Jakovljevic

I like this approach. Just a question, do you often write tests for external packages? I suppose that react-select has their own set of tests.

Collapse
 
jonmajorc profile image
Jon Major Condon

Thanks! Although react-select has its own tests, those tests do not integrate with our app. I write tests to test user behavior, so I will access third-party libraries to simulate user interaction within an app. I could mock but both ways come with a cost, and I think the tradeoffs for mocking doesn't outweigh testing with the actual component. (But I won't ever say "I won't ever use a mock")