-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
vitest.browser.config.mts
54 lines (51 loc) · 1.18 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
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"],
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: "webdriverio",
headless: true,
enabled: true,
name: "chrome",
},
},
};
export default mergeConfig(sharedConfig, defineProject(config));