45 lines
1.3 KiB
JavaScript
45 lines
1.3 KiB
JavaScript
import path from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
import { defineConfig } from "../../frontend/node_modules/vitest/dist/config.js";
|
|
import vue from "../../frontend/node_modules/@vitejs/plugin-vue/dist/index.mjs";
|
|
|
|
const testingDir = path.dirname(fileURLToPath(import.meta.url));
|
|
const frontendRoot = path.resolve(testingDir, "../../frontend");
|
|
|
|
export default defineConfig({
|
|
root: frontendRoot,
|
|
plugins: [vue()],
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(frontendRoot, "src"),
|
|
},
|
|
},
|
|
test: {
|
|
environment: "jsdom",
|
|
globals: true,
|
|
include: [path.resolve(testingDir, "unit/**/*.spec.js")],
|
|
setupFiles: [path.resolve(testingDir, "vitest.setup.js")],
|
|
reporters: ["default", "junit"],
|
|
outputFile: {
|
|
junit: path.resolve(testingDir, "../../build/junit-frontend-unit.xml"),
|
|
},
|
|
coverage: {
|
|
provider: "v8",
|
|
reporter: ["text", "lcov", "json-summary"],
|
|
include: [
|
|
"src/auth.js",
|
|
"src/data/sample.js",
|
|
"src/components/MetricRow.vue",
|
|
"src/components/MermaidCard.vue",
|
|
"src/components/ServiceGrid.vue",
|
|
"src/components/StatsGrid.vue",
|
|
"src/views/HomeView.vue",
|
|
],
|
|
thresholds: {
|
|
lines: 95,
|
|
statements: 95,
|
|
},
|
|
},
|
|
},
|
|
});
|