-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathvitest.config.ts
More file actions
24 lines (23 loc) · 805 Bytes
/
Copy pathvitest.config.ts
File metadata and controls
24 lines (23 loc) · 805 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
import path from "node:path";
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
environment: "node",
include: ["src/**/*.test.ts", "src/**/*.test.tsx"],
exclude: ["node_modules", ".next", "tests/e2e/**"],
coverage: {
provider: "v8",
reporter: ["text", "html"],
include: ["src/**/*.{ts,tsx}"],
exclude: ["src/**/*.test.{ts,tsx}", "src/**/*.d.ts", "src/app/**", "src/components/**"],
},
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
// `server-only` is a Next.js build-time guard with no runtime; stub it so server
// modules that import it can be unit-tested under the node environment.
"server-only": path.resolve(__dirname, "./src/test/server-only-stub.ts"),
},
},
});