Skip to content

This is the basic example to create a vue/vite project and integrate vitest

Notifications You must be signed in to change notification settings

JaimeRamirezSV/basic-example-itb-2023

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic example

This is the basic example to create a vue/vite project and integrate vitest

Use node 18+

Create the base project

npm create vite@latest ITB-2023 -- --template vue

Install vitest

npm install -D vitest

Update vite.config.js

export default defineConfig({
  plugins: [vue()],
  test : {
    globals : true,
    environment : "jsdom"
  }
});

Install jsDom

npm install -D jsdom

Install vitest/ui

npm i -D @vitest/ui

Update package.json

"tests" : "vitest --ui --api 9527"

Add src/tests and create this example.test.js

import { describe, it } from "vitest";

describe( "My example", () => {
   it.todo( "is my example", () => {
    //
   } );
} );

About

This is the basic example to create a vue/vite project and integrate vitest

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published