Member-only story
Simple Unit Testing with Vitest: NextJS App
Try to follow the guide for building a basic Unit Test of Vitest in the NextJS App
What is testing?
Testing is the process of checking the quality of any instance.
What is software testing?
Software testing is the ensuring that code works as supposed to work.
What are the types of software tests?
- Unit testing
- End-to-End testing
- Spanshot testing
In this article, I will explain “Unit Testing”.
What is Unit Testing?
Unit testing considers only a unit in an isolated environment whereas there could be a block of code a.k.a function, or component.
For better understanding, I will create a simple project to illustrate how to start working with unit testing.
I will create a NextJS project with Vitest testing which is unit testing.
mkdir test-next-vitest
Let’s create a folder for the project with the name test-next-vitest
cd test-next-vitest
code .
npx create-next-app@latest --example with-vitest ./