test: add vitest for unit tests (#50)

* feat: add vitest for unit tests

* chore: address pull request feedback

* test: add unit test code quality workflow
This commit is contained in:
Meier Lukas
2024-02-04 09:47:23 +01:00
committed by GitHub
parent ca04bf692d
commit ae12f0c9df
6 changed files with 1119 additions and 87 deletions

23
vitest.config.ts Normal file
View File

@@ -0,0 +1,23 @@
import react from "@vitejs/plugin-react";
import tsconfigPaths from "vite-tsconfig-paths";
import { configDefaults, defineConfig } from "vitest/config";
export default defineConfig({
plugins: [react(), tsconfigPaths()],
test: {
include: ["**/*.spec.ts"],
poolOptions: {
threads: {
singleThread: false,
},
},
coverage: {
provider: "v8",
reporter: ["html", "json-summary", "json"],
all: true,
exclude: ["apps/nextjs/.next/"],
},
exclude: [...configDefaults.exclude, "apps/nextjs/.next"],
},
});