diff --git a/.gitignore b/.gitignore index a547bf3..97bee46 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,5 @@ dist-ssr *.njsproj *.sln *.sw? + +coverage diff --git a/package.json b/package.json index fc55ac5..230bb53 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,8 @@ "dev": "vite", "lint": "eslint \"{src,api,docs}/**/*.{js,jsx,ts,tsx}\" --fix", "preview": "vite preview", + "test": "vitest --passWithNoTests", + "test:coverage": "vitest --coverage --passWithNoTests", "type-check": "tsc --noEmit" }, "dependencies": { @@ -29,6 +31,7 @@ "@types/react": "^18.2.15", "@types/react-dom": "^18.2.7", "@vitejs/plugin-react-swc": "^3.3.2", + "@vitest/coverage-v8": "latest", "commitlint": "^17", "eslint": "^8.45.0", "eslint-plugin-react-hooks": "^4.6.0", @@ -39,6 +42,7 @@ "semantic-release": "^21", "stylelint": "^15", "typescript": "^5.0.2", - "vite": "^4.4.5" + "vite": "^4.4.5", + "vitest": "latest" } } diff --git a/vitest.config.ts b/vitest.config.ts new file mode 100644 index 0000000..014f97e --- /dev/null +++ b/vitest.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + environment: 'node', + globals: true, + }, +});