Added vitest (#5)

* Moved eslint and @nuxt/eslint to devDependencies

* Added vitest to project and 1 test

* Tweaked Sonar workflow in order to run tests and coverage

* Removed offending config line
This commit is contained in:
Liviu Burcusel 2025-10-24 17:20:05 +02:00 committed by GitHub
parent c98879430b
commit 3b58a25ccf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 942 additions and 15 deletions

44
vitest.config.ts Normal file
View file

@ -0,0 +1,44 @@
import { defineConfig } from "vitest/config";
import vue from "@vitejs/plugin-vue";
import { resolve } from "path";
export default defineConfig({
plugins: [vue()],
test: {
globals: true,
setupFiles: ["./tests/setup.ts"],
environment: "happy-dom",
include: ["tests/**/*.test.ts"],
coverage: {
provider: "v8",
reporter: ["text", "html", "lcov"],
clean: true,
cleanOnRerun: true,
exclude: [
"node_modules/**",
"dist/**",
"coverage/**",
"**/*.test.ts",
"tests/mocks/**",
// Exclude Nuxt generated files
".nuxt/**",
".output/**",
// Exclude TypeScript declaration files
"**/*.d.ts",
// Exclude config files
"*.config.*",
"assets/icons/**",
],
},
name: "GFiesta",
},
resolve: {
alias: {
"~": resolve(__dirname, "./app"),
"@": resolve(__dirname, "./app"),
},
},
});