mirror of
https://github.com/jackwener/OpenCLI.git
synced 2026-09-14 18:25:42 +08:00
dba93c2739
Split browser-public.test.ts: core sites (bilibili, zhihu, v2ex) run by default; all other 20+ site tests moved to browser-public-extended and gated behind OPENCLI_E2E=1 to prevent AI agents from launching dozens of browser instances.
54 lines
1.4 KiB
TypeScript
54 lines
1.4 KiB
TypeScript
import { defineConfig } from 'vitest/config';
|
|
|
|
const includeExtendedE2e = process.env.OPENCLI_E2E === '1';
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
projects: [
|
|
{
|
|
test: {
|
|
name: 'unit',
|
|
include: ['src/**/*.test.ts'],
|
|
exclude: ['src/clis/**/*.test.ts'],
|
|
sequence: { groupOrder: 0 },
|
|
},
|
|
},
|
|
{
|
|
test: {
|
|
name: 'adapter',
|
|
include: [
|
|
'src/clis/bilibili/**/*.test.ts',
|
|
'src/clis/zhihu/**/*.test.ts',
|
|
'src/clis/v2ex/**/*.test.ts',
|
|
],
|
|
sequence: { groupOrder: 1 },
|
|
},
|
|
},
|
|
{
|
|
test: {
|
|
name: 'e2e',
|
|
include: [
|
|
'tests/e2e/browser-public.test.ts',
|
|
'tests/e2e/public-commands.test.ts',
|
|
'tests/e2e/management.test.ts',
|
|
'tests/e2e/output-formats.test.ts',
|
|
'tests/e2e/plugin-management.test.ts',
|
|
// Extended browser tests (20+ sites) — opt-in only:
|
|
// OPENCLI_E2E=1 npx vitest run
|
|
...(includeExtendedE2e ? ['tests/e2e/browser-public-extended.test.ts', 'tests/e2e/browser-auth.test.ts'] : []),
|
|
],
|
|
maxWorkers: 2,
|
|
sequence: { groupOrder: 2 },
|
|
},
|
|
},
|
|
{
|
|
test: {
|
|
name: 'smoke',
|
|
include: ['tests/smoke/**/*.test.ts'],
|
|
sequence: { groupOrder: 3 },
|
|
},
|
|
},
|
|
],
|
|
},
|
|
});
|