--------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by-agent: Codex
38 lines
1.0 KiB
TypeScript
38 lines
1.0 KiB
TypeScript
import { dirname } from 'node:path'
|
|
import { fileURLToPath } from 'node:url'
|
|
|
|
import { playwright } from '@vitest/browser-playwright'
|
|
import { loadEnv } from 'vite'
|
|
import { defineConfig } from 'vitest/config'
|
|
|
|
export default defineConfig(({ mode }) => ({
|
|
test: {
|
|
projects: [
|
|
{
|
|
test: {
|
|
name: 'node',
|
|
root: dirname(fileURLToPath(import.meta.url)),
|
|
env: loadEnv(mode, dirname(fileURLToPath(import.meta.url))),
|
|
exclude: ['**/*.browser.{spec,test}.ts', '**/node_modules/**'],
|
|
},
|
|
},
|
|
{
|
|
test: {
|
|
name: 'browser',
|
|
root: dirname(fileURLToPath(import.meta.url)),
|
|
include: ['**/*.browser.{spec,test}.ts'],
|
|
exclude: ['**/node_modules/**'],
|
|
browser: {
|
|
provider: playwright(),
|
|
enabled: true,
|
|
// Vitest browser mode requires an explicit browser instance list.
|
|
instances: [
|
|
{ browser: 'chromium' },
|
|
],
|
|
},
|
|
},
|
|
},
|
|
],
|
|
},
|
|
}))
|