-
Notifications
You must be signed in to change notification settings - Fork 70
Expand file tree
/
Copy pathvitest.config.ts
More file actions
50 lines (49 loc) · 1.32 KB
/
vitest.config.ts
File metadata and controls
50 lines (49 loc) · 1.32 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { playwright } from "@vitest/browser-playwright"
import tsconfigPaths from "vite-tsconfig-paths"
import { defineConfig } from "vitest/config"
export default defineConfig({
plugins: [tsconfigPaths()],
test: {
globals: true,
css: true,
coverage: {
include: ["app/**"],
reporter: ["text", "json-summary", "json"],
reportOnFailure: true,
},
projects: [
{
extends: true,
test: {
name: "server tests",
environment: "node",
// Include generic .test files that should work anywhere and .server.test files for server only, ignore .browser.test
include: ["./**/*.server.test.{ts,tsx}", "!./**/*.browser.test.{ts,tsx}", "./**/*.test.{ts,tsx}"],
},
},
{
extends: true,
optimizeDeps: {
include: ["react/jsx-dev-runtime"],
},
server: {
fs: {
strict: false,
},
},
test: {
includeTaskLocation: true,
// Include generic .test files that should work anywhere and .browser.test files for browser only, ignore .server.test
include: ["./**/*.test.{ts,tsx}", "./**/*.browser.test.{ts,tsx}", "!./**/*.server.test.{ts,tsx}"],
setupFiles: ["./tests/setup.browser.tsx"],
name: "browser tests",
browser: {
enabled: true,
instances: [{ browser: "chromium" }],
provider: playwright(),
},
},
},
],
},
})