-
Notifications
You must be signed in to change notification settings - Fork 418
Expand file tree
/
Copy pathvitest.config.ts
More file actions
45 lines (44 loc) · 1.33 KB
/
vitest.config.ts
File metadata and controls
45 lines (44 loc) · 1.33 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
import solid from "vite-plugin-solid";
import { defineConfig } from "vitest/config";
import { playwright } from "@vitest/browser-playwright";
import path from "path";
export default defineConfig({
resolve: {
alias: {
"~": path.resolve(__dirname, "./src"),
},
},
plugins: [solid()],
test: {
mockReset: true,
globals: true,
exclude: ["**/src/e2e/**"], // we need this to offload these to playwright, for e2e tests
projects: [
{
// 1. NODE Project (For fs, tree-shaking, server utilities)
extends: true,
test: {
include: ["**/*.server.test.ts"], // Matches the tree-shaking test
name: { label: "Node Logic", color: "green" },
environment: "node",
},
},
{
// 2. BROWSER Project (For Solid components and DOM interaction)
extends: true,
test: {
// Exclude the server files, include component/browser tests
include: ["**/*.{test,spec}.tsx", "**/*.browser.test.ts"],
name: { label: "Browser UI", color: "cyan" },
// Browser configuration must live inside the project's 'test' key
browser: {
provider: playwright(),
enabled: true,
headless: true,
instances: [{ browser: "chromium" }],
},
},
},
],
},
});