2026-07-10 00:48:52 -07:00
|
|
|
import { configDefaults, defineConfig } from 'vitest/config'
|
2026-06-04 20:27:33 +08:00
|
|
|
|
2026-07-10 00:48:52 -07:00
|
|
|
// Convention: `*.live.test.ts` hits real provider APIs (slow, costs tokens)
|
|
|
|
|
// and only runs via `npm run test:live`. Everything else runs on `npm test`.
|
2026-06-04 20:27:33 +08:00
|
|
|
export default defineConfig({
|
|
|
|
|
test: {
|
|
|
|
|
// Suppress console output from passing tests; failed tests still get their logs.
|
|
|
|
|
silent: 'passed-only',
|
2026-07-10 00:48:52 -07:00
|
|
|
projects: [
|
|
|
|
|
{
|
|
|
|
|
test: {
|
|
|
|
|
name: 'llms',
|
|
|
|
|
include: ['src/**/*.test.ts'],
|
|
|
|
|
exclude: [...configDefaults.exclude, 'src/**/*.live.test.ts'],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
test: {
|
|
|
|
|
name: 'llms:live',
|
|
|
|
|
include: ['src/**/*.live.test.ts'],
|
|
|
|
|
// Keep live provider suites under OpenRouter's ~20 req/min free-route cap.
|
|
|
|
|
maxConcurrency: 2,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
2026-06-04 20:27:33 +08:00
|
|
|
},
|
|
|
|
|
})
|