A hands-on React testing project focused on building reliable and maintainable frontend applications using modern testing tools.
React Testing Course is a practical project for learning and practicing modern frontend testing with React, Vitest, and React Testing Library. It uses the GitHub API to fetch real-time data and provides test cases to validate components, API responses, user interactions, state changes, and application behavior.
The project focuses on writing reliable tests for real-world API-driven React applications, with an emphasis on testing from the user's perspective.
Explore the React Testing Course directly in your browser.
| Technology | Purpose |
|---|---|
| ⚛️ React 19 | UI development |
| 🔷 TypeScript | Type-safe development |
| ⚡ Vite | Development & build tooling |
| 🧪 Vitest | Test runner |
| 🧰 React Testing Library | Component testing |
| 🖱️ User Event | User interaction testing |
| ❤️ jest-dom | DOM assertions |
| 🌐 JSDOM | Browser-like test environment |
- 🧩 Component testing
- 🖱️ User interaction testing
- 📝 Form testing
- 🔄 State & UI updates
- ⏳ Asynchronous testing
- 🔍 DOM queries
- ✅ DOM assertions
- 📊 Test coverage
- 🛡️ Regression testing
Test behavior, not implementation.
Tests are written from the user's perspective using accessible queries such as:
getByRole()
getByLabelText()
getByText()git clone https://github.com/prabhatrana666/react-testing-course.git
cd react-testing-coursenpm installnpm run dev| Command | Description |
|---|---|
npm test |
Run tests |
npm test -- --run |
Run tests once |
npm run coverage |
Generate coverage |
npm run lint |
Run ESLint |
npm run build |
Production build |
npm run preview |
Preview production build |
Prabhat Rana — Frontend Developer
- 🌐 Portfolio: prabhatrana.online
- 💼 LinkedIn: Prabhat Rana
- 🐙 GitHub: @prabhatrana666
If you find this project useful, consider giving the repository a ⭐ star.
Built with React • TypeScript • Vite • Vitest • React Testing Library