2026-03-02 14:35:49 +00:00
|
|
|
import { defineConfig } from "vitest/config";
|
|
|
|
|
import baseConfig from "./vitest.config.ts";
|
|
|
|
|
|
2026-03-14 11:23:25 -07:00
|
|
|
export function createScopedVitestConfig(include: string[], options?: { exclude?: string[] }) {
|
2026-03-02 14:35:49 +00:00
|
|
|
const base = baseConfig as unknown as Record<string, unknown>;
|
|
|
|
|
const baseTest = (baseConfig as { test?: { exclude?: string[] } }).test ?? {};
|
2026-03-14 11:23:25 -07:00
|
|
|
const exclude = [...(baseTest.exclude ?? []), ...(options?.exclude ?? [])];
|
2026-03-02 14:35:49 +00:00
|
|
|
|
|
|
|
|
return defineConfig({
|
|
|
|
|
...base,
|
|
|
|
|
test: {
|
|
|
|
|
...baseTest,
|
|
|
|
|
include,
|
|
|
|
|
exclude,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|