28 lines
843 B
TypeScript
28 lines
843 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}"],
|
|
// before-react.ts first: setup.ts imports React.
|
|
setupFiles: ["src/test/before-react.ts", "src/test/setup.ts"],
|
|
restoreMocks: true,
|
|
unstubGlobals: true,
|
|
css: false,
|
|
coverage: {
|
|
provider: "v8",
|
|
include: ["src/**/*.{ts,tsx}"],
|
|
exclude: ["src/test/**"],
|
|
reporter: ["text", "html", "lcov"],
|
|
reportsDirectory: "coverage/web",
|
|
},
|
|
},
|
|
}),
|
|
);
|