2024-10-03 12:49:44 +02:00

23 lines
726 B
TypeScript

import type { UserConfig as ViteUserConfig } from 'vite'
import type { UserConfig } from 'vitest'
import { runVitest } from '../../test-utils'
export const provider = process.env.PROVIDER || 'playwright'
export const browser = process.env.BROWSER || (provider !== 'playwright' ? 'chromium' : 'chrome')
export async function runBrowserTests(
config?: Omit<UserConfig, 'browser'> & { browser?: Partial<UserConfig['browser']> },
include?: string[],
viteOverrides?: Partial<ViteUserConfig>,
) {
return runVitest({
watch: false,
reporters: 'none',
...config,
browser: {
headless: browser !== 'safari',
...config?.browser,
} as UserConfig['browser'],
}, include, 'test', viteOverrides)
}