This change introduces the fileURLToPath import to enhance path handling in the configuration files.
43 lines
1.4 KiB
TypeScript
43 lines
1.4 KiB
TypeScript
import path from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
import { defineConfig } from "vitest/config";
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
|
export default defineConfig({
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./resources/assets"),
|
|
"@bo": path.resolve(__dirname, "./resources/ts/bo"),
|
|
"@fo": path.resolve(__dirname, "./resources/ts/fo"),
|
|
"@modules": path.resolve(__dirname, "./resources/ts/modules"),
|
|
"@defs": path.resolve(__dirname, "./resources/ts/types"),
|
|
"@utilities": path.resolve(__dirname, "./resources/ts/utilities"),
|
|
},
|
|
},
|
|
test: {
|
|
reporters: process.env.CI ? ["default", "junit"] : ["default"],
|
|
outputFile: process.env.CI ? { junit: "coverage/junit-vitest.xml" } : undefined,
|
|
include: ["resources/ts/**/*.test.ts"],
|
|
globals: false,
|
|
environment: "node",
|
|
coverage: {
|
|
provider: "v8",
|
|
reportsDirectory: "coverage/frontend",
|
|
reporter: ["text", "lcov", "html"],
|
|
include: [
|
|
"resources/ts/**/*.ts",
|
|
],
|
|
exclude: [
|
|
"resources/ts/**/*.test.ts",
|
|
"resources/ts/**/*.d.ts",
|
|
"resources/ts/bo/bo.ts",
|
|
"resources/ts/fo/fo.ts",
|
|
"resources/ts/**/utilities/bootstrap.ts",
|
|
"resources/ts/**/utilities/fontawesome.ts",
|
|
"resources/ts/types/**/*.ts",
|
|
],
|
|
},
|
|
},
|
|
});
|