https://github.com/arrudadev/react-unit-testing
A simple example of how to build tests in a React app using Jest and Testing library.
https://github.com/arrudadev/react-unit-testing
jest react-testing-library reactjs typescript
Last synced: 4 months ago
JSON representation
A simple example of how to build tests in a React app using Jest and Testing library.
- Host: GitHub
- URL: https://github.com/arrudadev/react-unit-testing
- Owner: arrudadev
- License: mit
- Created: 2022-02-18T20:32:09.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-03T15:46:11.000Z (over 3 years ago)
- Last Synced: 2025-01-14T09:30:57.141Z (5 months ago)
- Topics: jest, react-testing-library, reactjs, typescript
- Language: TypeScript
- Homepage:
- Size: 319 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
![]()
Unit Testing in React with Jest
A simple example of how to build tests in a React app using Jest and Testing library.
[](https://opensource.org/licenses/MIT)
[](http://makeapullrequest.com)

[](https://github.com/arrudadev/react-unit-testing/actions/workflows/build.yml)
[](https://codecov.io/gh/arrudadev/react-unit-testing)
:pushpin: Table of Contents
* [About The Project](#about-the-project)
* [Technologies](#technologies)
* [Getting Started](#getting-started)
* [Prerequisites](#prerequisites)
* [Installation](#installation)
* [Usage](#usage)
* [Contributing](#contributing)
* [Collaborators](#collaborators)
* [License](#license):pencil: About The Project
This project is a small example of how to build tests in a React app using Jest and Testing library. Jest is a framework to build tests in Javascript. The React Testing Library is a very light-weight solution for testing React components. It provides light utility functions on top of react-dom and react-dom/test-utils, in a way that encourages better testing practices. The purpose of this project is to study how to build tests in a React app using Jest and Testing library.:computer: Technologies
This project was developed with the following technologies:
- [React](https://reactjs.org)
- [Vite](https://vitejs.dev/)
- [Typescript](https://www.typescriptlang.org/)
- [Jest](https://jestjs.io/pt-BR/)
- [React Testing Library](https://testing-library.com/docs/react-testing-library/intro/):runner: Getting Started
To run the project locally follow these steps::warning: Prerequisites
- [NodeJs](https://nodejs.org/en/) Prefer to install the LTS version.
- [Yarn](https://yarnpkg.com/) Need to install latest version prior to 2.0 version.:construction_worker: Installation
1. To clone the project, run this command:```
git clone https://github.com/arrudadev/react-unit-testing.git
```
2. Install dependencies:```
yarn install
```:metal: Usage
Run the following command to run the tests:```
yarn test
```:tada: Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue. Don't forget to give the project a star! Thanks again!1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/amazing-feature`)
3. Commit your Changes (`git commit -m 'feat: Add some Amazing Feature'`)
4. Push to the Branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request**After your pull request is merged**, you can safely delete your branch.
For more information read the [Contributing Guidelines](https://github.com/arrudadev/react-unit-testing/blob/main/CONTRIBUTING.md).
:smile: Collaborators
People who contributed to this project.:page_facing_up: License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.