Use .ts files for vite config for type safety

This commit is contained in:
Hugh Nimmo-Smith
2024-12-18 13:32:19 +00:00
parent 6b8dddfaaa
commit 99c5a1a250
4 changed files with 31 additions and 7 deletions

32
vitest.config.ts Normal file
View File

@@ -0,0 +1,32 @@
/*
Copyright 2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only
Please see LICENSE in the repository root for full details.
*/
import { defineConfig, mergeConfig } from "vitest/config";
import viteConfig from "./vite.config";
export default defineConfig((configEnv) =>
mergeConfig(
viteConfig(configEnv),
defineConfig({
test: {
environment: "jsdom",
css: {
modules: {
classNameStrategy: "non-scoped",
},
},
setupFiles: ["src/vitest.setup.ts"],
coverage: {
reporter: ["html", "json"],
include: ["src/"],
exclude: ["src/**/*.{d,test}.{ts,tsx}", "src/utils/test.ts"],
},
},
}),
),
);