Repository navigation
Expand file tree
/
Copy pathvitest.config.ts
More file actions
80 lines (78 loc) · 1.78 KB
/
Copy pathvitest.config.ts
File metadata and controls
80 lines (78 loc) · 1.78 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import path from "node:path";
import { playwright } from "@vitest/browser-playwright";
import { cjsInterop } from "vite-plugin-cjs-interop";
import relay from "vite-plugin-relay-lite";
import solid from "vite-plugin-solid";
import { defineConfig, type Plugin } from "vitest/config";
import { ssrBrowserCommands, ssrTestPlugin } from "./tests/ssr/harness/vitest";
const commonPlugins = (): Plugin[] => [
relay({
codegen: false,
omitTagImport: true,
relayConfig: "tests/relay.config.json",
}),
];
export default defineConfig({
resolve: {
alias: {
"solid-relay": path.join(__dirname, "src"),
},
},
test: {
globals: true,
environment: "node",
coverage: {
include: ["src/**/*"],
},
setupFiles: ["./vitest.setup.ts"],
fileParallelism: false,
projects: [
{
extends: true,
plugins: [{ ...solid(), configEnvironment: undefined }, ...commonPlugins()],
resolve: {
conditions: ["solid", "development", "browser"],
},
test: {
name: "browser",
browser: {
enabled: true,
provider: playwright(),
instances: [{ browser: "chromium" }],
},
include: ["tests/**/*.test.tsx"],
},
},
{
extends: true,
plugins: [
{
...solid({ ssr: true }),
configEnvironment: undefined,
},
ssrTestPlugin(),
cjsInterop({ dependencies: ["relay-runtime"] }),
...commonPlugins(),
],
resolve: {
conditions: ["solid", "development", "browser"],
},
ssr: {
resolve: {
conditions: ["solid", "development", "node"],
},
},
test: {
name: "ssr",
browser: {
enabled: true,
provider: playwright(),
instances: [{ browser: "chromium" }],
commands: ssrBrowserCommands,
},
include: ["tests/**/*.test.ssr.tsx"],
},
},
],
},
});