Skip to content

LinkedInLearning/testing-in-react-with-vitest-3816043

Repository files navigation

Testing in React with Vitest

This is the repository for the LinkedIn Learning course Testing in React with Vitest. The full course is available from LinkedIn Learning.

lil-thumbnail-url

This course guides you through the process of setting up and testing web applications using Vitest integrated with the React Testing Library and other essential libraries. Learn how to set up a React app with Vite, install dependencies, and initialize your project, as you explore the basics of Vitest and how it can fit into your testing strategy with instructor Cyrus Ndirangu. Configure ESLint and Prettier to maintain code quality and style consistency, before you get started with your first unit test. Progressively, discover best practices for testing application state and hooks quickly and efficiently. By the end of the course, you’ll be ready to write tests that validate your application's functionality, including testing mock API requests and ensuring correct routing using the React Router. With practical examples and expert guidance throughout, this course shows you why testing is so crucial and how to use it to improve your development workflow.

See the readme file in the main branch for updated instructions and information.

Instructions

This repository has branches for each of the videos in the course. You can use the branch pop up menu in github to switch to a specific branch and take a look at the course at that stage, or you can add /tree/BRANCH_NAME to the URL to go to the branch you want to access.

Branches

The branches are structured to correspond to the videos in the course. The naming convention is CHAPTER#_MOVIE#. As an example, the branch named 02_03 corresponds to the second chapter and the third video in that chapter. Some branches will have a beginning and an end state. These are marked with the letters b for "beginning" and e for "end". The b branch contains the code as it is at the beginning of the movie. The e branch contains the code as it is at the end of the movie. The main branch holds the final state of the code when in the course.

When switching from one exercise files branch to the next after making changes to the files, you may get a message like this:

error: Your local changes to the following files would be overwritten by checkout:        [files]
Please commit your changes or stash them before you switch branches.
Aborting

To resolve this issue:

Add changes to git using this command: git add .
Commit changes using this command: git commit -m "some message"

Instructor

Cyrus Ndirangu

Software Engineer | Computer Science Educator | Founder

Check out my other courses on LinkedIn Learning.

About

This repo is for linkedin learning course: Testing in React with Vitest

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published