import { defineConfig, mergeConfig } from 'vitest/config'; import { playwright } from '@vitest/browser-playwright'; import viteConfig from './vite.config.js'; /** * Vitest configuration. * * Tests run in a real Chromium rather than a DOM emulation. Shadow DOM, * adopted stylesheets, `:focus-visible` and custom element upgrade timing are * exactly the things a component test needs to exercise, and they are also * the things jsdom/happy-dom approximate least well. * * The Vite config is merged in rather than duplicated so the TypeScript * decorator settings used to build the app are the same ones used to compile * the tests. Divergence there produces failures that are very hard to read. */ export default mergeConfig( viteConfig, defineConfig({ test: { include: ['src/**/*.test.ts'], browser: { enabled: true, provider: playwright(), headless: true, instances: [{ browser: 'chromium' }], }, }, }), );