-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Expand file tree
/
Copy pathvitest.config.ts
More file actions
86 lines (84 loc) · 2.18 KB
/
vitest.config.ts
File metadata and controls
86 lines (84 loc) · 2.18 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
81
82
83
84
85
86
import { defineConfig, UserWorkspaceConfig } from "vitest/config";
import { languageHashes } from "./vite-plugins/language-hashes";
import { envConfig } from "./vite-plugins/env-config";
import solidPlugin from "vite-plugin-solid";
const plugins = [
languageHashes({ skip: true }),
envConfig({ isDevelopment: true, clientVersion: "TESTING", env: {} }),
solidPlugin({ hot: false }),
];
export const projects: UserWorkspaceConfig[] = [
{
test: {
name: { label: "unit", color: "blue" },
include: ["__tests__/**/*.spec.ts"],
exclude: ["__tests__/**/*.jsdom-spec.ts"],
environment: "happy-dom",
globalSetup: "__tests__/global-setup.ts",
setupFiles: [
"__tests__/__harness__/mock-dom.ts",
"__tests__/__harness__/mock-firebase.ts",
"__tests__/__harness__/mock-env-config.ts",
],
},
plugins,
},
{
test: {
name: { label: "jsdom", color: "yellow" },
include: ["__tests__/**/*.jsdom-spec.ts"],
environment: "jsdom",
globalSetup: "__tests__/global-setup.ts",
},
plugins,
},
{
ssr: {
noExternal: [
"@solidjs/meta",
"@tanstack/solid-store",
"@tanstack/solid-form",
"@tanstack/solid-query",
"@tanstack/solid-table",
"@tanstack/solid-hotkeys",
"@tanstack/solid-db",
],
},
test: {
name: { label: "jsx", color: "green" },
include: ["__tests__/**/*.spec.tsx"],
environment: "jsdom",
globalSetup: "__tests__/global-setup.ts",
setupFiles: [
"__tests__/__harness__/setup-jsx.ts",
"__tests__/__harness__/mock-dom.ts",
],
globals: true,
},
plugins,
},
];
export default defineConfig({
test: {
projects: projects as never,
coverage: {
include: ["**/*.ts", "**/*.tsx"],
},
deps: {
optimizer: {
web: {
include: [
"@monkeytype/funbox",
"@tanstack/solid-store",
"@tanstack/solid-form",
"@tanstack/solid-query",
"@tanstack/solid-table",
"@tanstack/solid-hotkeys",
"@tanstack/solid-db",
],
},
},
},
},
plugins,
});