How to Install Vitest — Transcript

Transcript of the free Vue.js lesson How to Install Vitestwatch the video lesson.

So let's first install Vtest. Here we are going to learn two ways of doing that. If you are using Vue, the quickest way to get your hands on Vtest is to use the official Vue starter template. To get started, we can open up the terminal and type npm init vue s3 to see the promotes.

The create Vue template offers many options for you to choose from based on what you need. Here we just quick skip all the rest and only check add Vtest for unit testing. Following the instructions, we'll change our directory to the generate project and use VS Code to open it. Then we can run npm install to install the dependencies.

json, you can see that vdes is defined in the script as testunit. That means we can type npm rom testunit to start the test. Great, we got one test and it's passing. We can see the test file exists under source-components-test directory.

In the rest of the course, we will go through the details of how to write them ourselves step by step. On the other way, let's try to install Videsh manually. Similar to Vue, Videsh is also a framework agnostic. js or even Verena JavaScript.

First, we can either open up an existing project or create a new one. Here I will create a new project quickly. json. Then we can run npm install vdash dash d to install our test runner.

Dash d for marking it as a development-only dependency. json. Here we will name it test so we can run npm run test to start it. We can see that vdash dash running.

However, it exists with no test files found error. Don't worry, this means we have successfully installed VDAS to our project. And in the next license, we will learn how to create your first test. So let's first install Vtest.

Here we are going to learn two ways of doing that. If you are using Vue, the quickest way to get your hands on Vtest is to use the official Vue starter template. To get started, we can open up the terminal and type npm init vue s3 to see the promotes. The create Vue template offers many options for you to choose from based on what you need.

Here we just quick skip all the rest and only check add Vtest for unit testing. Following the instructions, we'll change our directory to the generate project and use VS Code to open it. Then we can run npm install to install the dependencies. json, you can see that vdes is defined in the script as testunit.

That means we can type npm rom testunit to start the test. Great, we got one test and it's passing. We can see the test file exists under source-components-test directory. In the rest of the course, we will go through the details of how to write them ourselves step by step.

On the other way, let's try to install Videsh manually. Similar to Vue, Videsh is also a framework agnostic. js or even Verena JavaScript. First, we can either open up an existing project or create a new one.

Here I will create a new project quickly. json. Then we can run npm install vdash dash d to install our test runner. Dash d for marking it as a development-only dependency.

json. Here we will name it test so we can run npm run test to start it. We can see that vdash dash running. However, it exists with no test files found error.

Don't worry, this means we have successfully installed VDAS to our project. And in the next license, we will learn how to create your first test.