-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathvitest.config.ts
More file actions
93 lines (89 loc) · 1.97 KB
/
vitest.config.ts
File metadata and controls
93 lines (89 loc) · 1.97 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
87
88
89
90
91
92
93
import { fileURLToPath, URL } from "node:url";
import type { Options } from "tsup";
import { defineConfig } from "vitest/config";
import { default as tsupConfig } from "./tsup.config";
const rootPath = fileURLToPath(new URL("./", import.meta.url));
const resolveAlias = {
alias: [
{
find: /^@\//,
replacement: `${rootPath}/`,
},
],
};
// https://vitest.dev/guide/projects.html#test-projects
export default defineConfig({
resolve: resolveAlias,
test: {
projects: [
{
resolve: resolveAlias,
test: {
env: {
TZ: "UTC",
},
environment: "node",
include: ["checkpoint/**/*.test.ts"],
name: "checkpoint",
},
},
{
resolve: resolveAlias,
esbuild: {
define: (tsupConfig as Options).define,
},
test: {
env: {
TZ: "UTC",
},
environment: "node",
fileParallelism: false,
include: ["data/**/*.test.ts"],
name: "data",
},
},
{
resolve: resolveAlias,
test: {
env: {
TZ: "UTC",
},
environment: "node",
include: ["demo/**/*.test.ts"],
name: "demo",
},
},
{
resolve: resolveAlias,
test: {
env: {
TZ: "UTC",
},
environment: "node",
include: ["scripts/**/*.test.ts"],
name: "release",
},
},
{
resolve: resolveAlias,
test: {
environment: "happy-dom", // or "jsdom"
include: ["ui/**/*.test.{ts,tsx}"],
name: "ui",
},
},
{
resolve: resolveAlias,
test: {
environment: "node",
include: ["**/*.e2e.{ts,tsx}"],
name: "e2e",
// browser: {
// enabled: true,
// headless: true,
// },
},
},
],
},
});