Files
gerbeur/vitest.config.ts

27 lines
777 B
TypeScript

import { defineConfig, mergeConfig } from "vitest/config";
import viteConfig from "./vite.config.ts";
// The app's own Vite config, so the tests compile exactly what ships: the SWC
// React transform with the Lingui macro plugin, and .po catalogs through the
// Lingui loader.
export default mergeConfig(
viteConfig,
defineConfig({
test: {
environment: "jsdom",
include: ["src/**/*.test.{ts,tsx}"],
setupFiles: ["src/test/setup.ts"],
restoreMocks: true,
unstubGlobals: true,
css: false,
coverage: {
provider: "v8",
include: ["src/**/*.{ts,tsx}"],
exclude: ["src/test/**", "src/locales/**"],
reporter: ["text", "html", "lcov"],
reportsDirectory: "coverage/web",
},
},
}),
);