multica/vitest.config.ts
Jiayuan Zhang f525d6ccfe test: add vitest setup with static mock policy checker
Scans test files at startup and warns when vi.mock() targets internal
modules (relative paths or @multica/* packages). Reports file paths
and line numbers for all violations without interfering with test
execution.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 22:03:36 +08:00

20 lines
558 B
TypeScript

import { fileURLToPath } from "node:url";
import path from "node:path";
import { defineConfig } from "vitest/config";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export default defineConfig({
test: {
globals: true,
environment: "node",
setupFiles: [path.resolve(__dirname, "vitest.setup.ts")],
include: ["src/**/*.test.ts"],
coverage: {
provider: "v8",
reporter: ["text", "html"],
include: ["src/**/*.ts"],
exclude: ["src/**/*.test.ts", "src/**/types.ts", "src/**/*.d.ts"],
},
},
});