Skip to content
Source
Sign inSign up
TanStack/form
Open History to see the last commit

vitest.config.ts

47 lines1.1 KB

1import { defineConfig } from 'vitest/config'
2import react from '@vitejs/plugin-react'
3import { playwright } from '@vitest/browser-playwright'
4import packageJson from './package.json' with { type: 'json' }
5​
6export default defineConfig({
7 plugins: [react()],
8 test: {
9 name: packageJson.name,
10 dir: './tests',
11 watch: false,
12 setupFiles: ['vitest-browser-react', './tests/test-setup.ts'],
13 globals: true,
14 browser: {
15 enabled: true,
16 provider: playwright(
17 process.env.CI ? { launchOptions: { channel: 'chrome' } } : {},
18 ),
19 instances: [{ browser: 'chromium', headless: true }],
20 },
21 coverage: {
22 enabled: true,
23 provider: 'istanbul',
24 include: ['src/**/*'],
25 },
26 projects: [
27 {
28 extends: true,
29 test: {
30 name: `${packageJson.name}: normal`,
31 env: {
32 VITEST_REACT_STRICT_MODE: 'false',
33 },
34 },
35 },
36 {
37 extends: true,
38 test: {
39 name: `${packageJson.name}: strict`,
40 env: {
41 VITEST_REACT_STRICT_MODE: 'true',
42 },
43 },
44 },
45 ],
46 },
47})