-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvitest.visual.config.ts
More file actions
52 lines (51 loc) · 1.67 KB
/
Copy pathvitest.visual.config.ts
File metadata and controls
52 lines (51 loc) · 1.67 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
import { defineConfig } from 'vitest/config';
import vue from '@vitejs/plugin-vue';
import { playwright } from '@vitest/browser-playwright';
import { fileURLToPath, URL } from 'node:url';
/**
* Standalone config for visual regression tests.
* Does NOT extend vite.config.ts test section to avoid inheriting
* setupFiles that import msw/node (incompatible with browser mode).
*/
export default defineConfig({
plugins: [
vue({
script: {
defineModel: true,
},
}),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
'vue-i18n': 'vue-i18n/dist/vue-i18n.esm-bundler.js',
},
},
optimizeDeps: {
include: ['jquery', 'select2', 'admin-lte/dist/js/adminlte.js', 'bootstrap/dist/js/bootstrap.bundle.js', 'popper.js'],
exclude: ['playwright', 'playwright-core', 'chromium-bidi'],
},
test: {
globals: true,
include: ['test/visual/**/*.visual.ts'],
exclude: ['**/.claire/**', '**/.claude/**', '**/node_modules/**'],
setupFiles: ['./test/visual/setup.ts'],
fileParallelism: false,
browser: {
enabled: true,
provider: playwright(),
trace: 'on',
instances: [{ browser: 'chromium' }],
viewport: { width: 1280, height: 800 },
expect: {
toMatchScreenshot: {
comparatorName: 'pixelmatch',
comparatorOptions: {
threshold: 0.2,
allowedMismatchedPixelRatio: 0.02,
},
},
},
},
},
});