-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
Copy pathvitest.browser.config.mts
59 lines (56 loc) · 1.23 KB
/
vitest.browser.config.mts
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
import { nodePolyfills } from "vite-plugin-node-polyfills";
import type { UserConfig } from "vitest/config";
import { mergeConfig, defineProject } from "vitest/config";
import sharedConfig from "./vitest.shared.config.mts";
const config: UserConfig = {
plugins: [
nodePolyfills({
globals: {
process: true,
Buffer: true,
global: true,
},
include: [
"crypto",
"buffer",
"fs",
"events",
"timers/promises",
"util",
"stream",
"path",
"fs",
"os",
],
overrides: {
fs: "memfs",
},
}),
],
optimizeDeps: {
exclude: [
"fsevents",
"path-scurry",
"@vitest/coverage-istanbul",
"chromium-bidi",
],
include: ["events", "timers/promises"],
entries: ["**/*.test.ts"],
},
test: {
env: {
LAUNCH_NODE_SERVER_PORT: "49342",
},
globalSetup: ["./vitest.global-browser-setup.ts"],
coverage: {
reportsDirectory: "coverage/environments/browser",
},
browser: {
provider: "playwright",
headless: true,
enabled: true,
name: "chromium",
},
},
};
export default mergeConfig(sharedConfig, defineProject(config));