Skip to content

Latest commit

 

History

History
54 lines (42 loc) · 770 Bytes

File metadata and controls

54 lines (42 loc) · 770 Bytes

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", () => {
    //
   } );
} );