-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
68 lines (66 loc) · 1.99 KB
/
Copy pathvite.config.ts
File metadata and controls
68 lines (66 loc) · 1.99 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
/// <reference types="vitest/config" />
import { defineConfig } from "vitest/config";
import react from "@vitejs/plugin-react";
import { URL } from "node:url";
import { playwright } from "@vitest/browser-playwright";
const aliases = {
"@/": new URL("./src/", import.meta.url).pathname,
"@src/": new URL("./src/", import.meta.url).pathname,
"@components/": new URL("./src/components/", import.meta.url).pathname,
"@pages/": new URL("./src/pages/", import.meta.url).pathname,
"@blog/": new URL("./src/blog/", import.meta.url).pathname,
"@layouts/": new URL("./src/layouts/", import.meta.url).pathname,
"@assets/": new URL("./src/assets/", import.meta.url).pathname,
"@styles/": new URL("./src/styles/", import.meta.url).pathname,
};
export default defineConfig({
resolve: {
alias: aliases,
},
test: {
clearMocks: true,
projects: [
{
resolve: {
alias: aliases,
},
test: {
globals: true,
// an example of file based convention,
// you don't have to follow it
include: ["src/**/*.test.ts"],
exclude: [
"**/node_modules/**",
"**/dist/**",
"**/cypress/**",
"**/.{idea,git,cache,output,temp}/**",
"**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*",
"**/*.browser.test.ts",
],
name: "unit",
environment: "node",
},
},
{
resolve: {
alias: aliases,
},
plugins: [react()],
test: {
globals: true,
// an example of file based convention,
// you don't have to follow it
include: ["src/**/*.browser.test.ts(x)"],
name: "browser",
browser: {
screenshotFailures: false,
enabled: true,
headless: true,
instances: [{ browser: "chromium" }],
provider: playwright(),
},
},
},
],
},
});