Replies: 2 comments 2 replies
-
|
My config, if it matters: /// <reference types="vitest/config" />
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
import { playwright } from '@vitest/browser-playwright';
import tailwindcss from '@tailwindcss/vite';
import tsconfigPaths from 'vite-tsconfig-paths';
/** @see https://vitejs.dev/config/ */
export default defineConfig({
plugins: [react(), tailwindcss(), tsconfigPaths()],
test: {
globals: true,
projects: [
{
extends: true, // also use root config
test: {
include: ['src/**/*.test.{ts,tsx}'], // if this changes, please update ESLint config too
exclude: ['src/**/*.browser.test.{ts,tsx}'],
environment: 'jsdom',
setupFiles: ['vitest.browser.setup.tsx', 'vitest.jsdom.setup.ts'],
},
},
{
extends: true, // also use root config
test: {
include: ['src/**/*.browser.test.{ts,tsx}'], // if this changes, please update ESLint config too
setupFiles: ['vitest.browser.setup.tsx'],
browser: {
enabled: true,
provider: playwright(),
instances: [{ browser: 'chromium' }],
headless: true,
// screenshotFailures: false,
},
},
},
],
coverage: {
include: ['src/**/*.{ts,tsx}'],
provider: 'istanbul',
reporter: ['text', 'lcov'],
},
},
}); |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
@kylemh Likely it's |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey folks! Congrats on v4. I've adopted and was trying out
toMatchScreenshotto make some visual regression diff tests and the output was surprising to me...so, there's a
.vitest-attachmentsfolder with.vitest-attachments/Reference-screenshot-87cb0abd024e566dc796aabea651788d6c094057.pngthen there's 2 co-located screenshots alongside the relevant test file path:
src/components/_ui/__tests__/__screenshots__/RadioGroup.browser.test.tsx/radio-group-chromium-darwin.pngsrc/components/_ui/__tests__/__screenshots__/RadioGroup.browser.test.tsx/RadioGroup-should-have-no-visual-regressions-1.pngthis is all for just one test:
why do all of these exist? which do I commit for CI?
Beta Was this translation helpful? Give feedback.
All reactions