In this project, I had to write tests for a React application that was already created and configured using Jest and React Testing Library (RTL).
The application contains a complete implementation of a Pokédex. My job was to write tests that ensured their correctness. The tests are in path src/tests
.
In this project, i was able to:
- Use React-Testing-Library selectors (queries) in automated tests;
- Simulate events with React-Testing-Library in automated tests;
- Testing asynchronous logic flows with the React-Testing-Library;
- Write tests that cause the structure of application components to be refactored without having to change them;
- Inputs Test.
Jest | RTL |
---|---|
|
|
- Clone and enter this repository
git clone git@github.com:ImVictorM/Testing-Using-ReactJS.git && cd Testing-Using-ReactJS
- Install the dependencies
npm install
- Start the project
npm start
Running all tests:
npm test
Running a specific test:
npm test {test_file_name}