forked from baron/baron-sso
ci: add code check badges and coverage reports
This commit is contained in:
@@ -2,6 +2,14 @@ import { fileURLToPath } from "node:url";
|
||||
import react from "@vitejs/plugin-react";
|
||||
import { defineConfig } from "vitest/config";
|
||||
|
||||
const commonRoot = fileURLToPath(new URL("../common", import.meta.url)).replace(
|
||||
/\\/g,
|
||||
"/",
|
||||
);
|
||||
const commonCoverageIncludes = ["core", "shell", "theme", "ui"].map(
|
||||
(directory) => `${commonRoot}/${directory}/**/*.{ts,tsx}`,
|
||||
);
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
server: {
|
||||
@@ -17,5 +25,27 @@ export default defineConfig({
|
||||
globals: true,
|
||||
environment: "jsdom",
|
||||
include: ["src/**/*.{test,spec}.{ts,tsx}"],
|
||||
coverage: {
|
||||
provider: "v8",
|
||||
reporter: ["text", "html", "lcov", "json-summary"],
|
||||
reportsDirectory: "coverage",
|
||||
all: true,
|
||||
allowExternal: true,
|
||||
include: ["src/**/*.{ts,tsx}", ...commonCoverageIncludes],
|
||||
exclude: [
|
||||
"**/*.{test,spec}.{ts,tsx}",
|
||||
"**/*.d.ts",
|
||||
"**/node_modules/**",
|
||||
"**/dist/**",
|
||||
"**/coverage/**",
|
||||
"src/main.tsx",
|
||||
"src/vite-env.d.ts",
|
||||
"../common/**/node_modules/**",
|
||||
"../common/.pnpm-store/**",
|
||||
`${commonRoot}/theme/**`,
|
||||
`${commonRoot}/core/pagination/*.worker.ts`,
|
||||
`${commonRoot}/core/query/queryClient.ts`,
|
||||
],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user