-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathvitest.workspace.ts
42 lines (40 loc) · 1.24 KB
/
vitest.workspace.ts
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
import { defineWorkspace } from "vitest/config"
// biome-ignore lint/nursery/noProcessEnv: Figure out the bug with --browser.headless, should work without this at all
const isHeadless = process.argv.includes("--browser.headless") || !!process.env.CI
export default defineWorkspace([
{
extends: "./vitest.config.ts",
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: "./vitest.config.ts",
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,
headless: isHeadless,
name: "chromium",
provider: "playwright",
// https://playwright.dev
providerOptions: {},
},
},
},
])