-
-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathvitest.config.ts
More file actions
25 lines (24 loc) · 725 Bytes
/
vitest.config.ts
File metadata and controls
25 lines (24 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { defineConfig } from "vitest/config";
export default defineConfig({
resolve: {
conditions: ["import", "module", "browser", "default"],
extensions: [".js", ".ts", ".jsx", ".tsx", ".json"],
},
test: {
globals: true,
environment: "jsdom",
setupFiles: ["./vitest-setup.ts"],
css: {
modules: {
classNameStrategy: "non-scoped",
},
},
},
ssr: {
// SSR configuration for handling Radix UI packages during testing
// Radix UI uses advanced ESM-only packages that can cause module resolution issues
// in test environments. By marking them as noExternal, Vitest bundles these packages
// properly instead of treating them as external dependencies.
noExternal: [/@radix-ui\/.*/],
},
});