docs icon indicating copy to clipboard operation
docs copied to clipboard

Testing components with react-test-library

Open wooller opened this issue 4 years ago • 3 comments

It would be great to have some documentation on using Amplify with react-testing-library (RTL). RTL has 13k+ stars on github and is now the recommended library to use when testing react components.

As a start i think it would be good to have some examples on testing Amplify UI components and components that use an Amplify API. Where we can mock the API service with JEST, so we can test them.

Maybe it could be a stage of the React - Getting started guide? Which has an API as well as Amplify UI components

There is documentation on Mocking Amplify services using amplify mock and how to set up end-to-end tests but i think that leaves a gap of how to perform fast unit tests which can be run in a CI environment.

Would love to hear further thoughts and recommendations.

wooller avatar Jan 07 '21 14:01 wooller