-
-
Notifications
You must be signed in to change notification settings - Fork 258
Expand file tree
/
Copy pathvitest.config.mjs
More file actions
40 lines (39 loc) · 987 Bytes
/
vitest.config.mjs
File metadata and controls
40 lines (39 loc) · 987 Bytes
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
import { defineConfig } from "vitest/config";
import { playwright } from "@vitest/browser-playwright";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
export default defineConfig({
plugins: [react(), tailwindcss()],
test: {
include: ["__tests__/*.jsx"],
setupFiles: ["./vitest.setup.mjs"],
browser: {
enabled: true,
provider: playwright({
contextOptions: {
deviceScaleFactor: 1,
},
}),
ui: false,
// https://vitest.dev/config/browser/playwright
provider: playwright(),
instances: [
{
browser: "chromium",
viewport: { width: 1440, height: 900 },
},
],
expect: {
toMatchScreenshot: {
screenshotOptions: {
scale: "css",
},
comparatorOptions: {
threshold: 0.2,
allowedMismatchedPixelRatio: 0.05,
},
},
},
},
},
});