-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
68 lines (67 loc) · 1.8 KB
/
Copy pathvitest.config.ts
File metadata and controls
68 lines (67 loc) · 1.8 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
import { defineConfig } from "vite-plus";
import { playwright } from "vite-plus/test/browser-playwright";
import tailwindcss from "@tailwindcss/vite";
export default defineConfig({
test: {
projects: [
{
test: {
include: [
"app/**/*.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}",
"!**/*.browser.test.{ts,tsx}",
"!**/__screenshots__/**",
],
name: "unit",
sequence: { groupOrder: 1 },
environment: "jsdom",
globals: true,
clearMocks: true,
isolate: false,
maxWorkers: 1,
setupFiles: ["./setup.unit.ts"],
env: {
SESSION_SECRET: "test-secret",
},
},
},
{
plugins: [tailwindcss()],
test: {
include: ["app/**/*.browser.test.{ts,tsx}", "!**/__screenshots__/**"],
name: "browser",
sequence: { groupOrder: 2 },
setupFiles: ["./setup.browser.ts"],
browser: {
provider: playwright(),
enabled: true,
headless: true,
screenshotFailures: false,
instances: [
{
browser: "chromium",
viewport: { width: 1280, height: 720 },
},
{
browser: "firefox",
viewport: { width: 1280, height: 720 },
},
],
expect: {
toMatchScreenshot: {
comparatorName: "pixelmatch",
comparatorOptions: {
threshold: 0.2,
allowedMismatchedPixelRatio: 0.01,
},
timeout: 10000,
},
},
},
},
},
],
coverage: {
provider: "v8",
},
},
});