Files
moeka-project/packages/stage-ui/vitest.config.ts
T
eabec9a64f feat(stage-ui-mmd): add MMD support (#1997)
---------

Co-authored-by: nyueki <nyuek.i@proton.me>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Neko Ayaka <neko@ayaka.moe>
Co-authored-by-agent: Unknown
2026-07-20 16:13:55 +08:00

54 lines
1.3 KiB
TypeScript

import { join } from 'node:path'
import { cwd } from 'node:process'
import Vue from '@vitejs/plugin-vue'
import Info from 'unplugin-info/vite'
import { playwright } from '@vitest/browser-playwright'
import { loadEnv } from 'vite'
import { defineConfig } from 'vitest/config'
export default defineConfig(({ mode }) => {
return {
root: import.meta.dirname,
plugins: [
Info(),
],
test: {
projects: [
{
extends: true,
test: {
name: 'node',
include: ['src/**/*.test.ts'],
exclude: ['src/**/*.browser.test.ts'],
env: loadEnv(mode, join(cwd(), 'packages', 'stage-ui'), ''),
fileParallelism: false,
hookTimeout: 20_000,
maxWorkers: 1,
testTimeout: 20_000,
},
},
{
extends: true,
plugins: [
Vue(),
],
test: {
name: 'browser',
include: ['**/*.browser.{spec,test}.ts'],
exclude: ['**/node_modules/**'],
browser: {
enabled: true,
provider: playwright(),
instances: [
{ browser: 'chromium' },
],
},
},
},
],
},
}
})