mirror of
https://github.com/hanzoai/bot.git
synced 2026-11-01 07:38:30 +00:00
Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: scoootscooob <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
18 lines
526 B
TypeScript
18 lines
526 B
TypeScript
import { defineConfig } from "vitest/config";
|
|
import baseConfig from "./vitest.config.ts";
|
|
|
|
export function createScopedVitestConfig(include: string[], options?: { exclude?: string[] }) {
|
|
const base = baseConfig as unknown as Record<string, unknown>;
|
|
const baseTest = (baseConfig as { test?: { exclude?: string[] } }).test ?? {};
|
|
const exclude = [...(baseTest.exclude ?? []), ...(options?.exclude ?? [])];
|
|
|
|
return defineConfig({
|
|
...base,
|
|
test: {
|
|
...baseTest,
|
|
include,
|
|
exclude,
|
|
},
|
|
});
|
|
}
|