mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
refactor(test): extract shared gateway hook and vitest scoped config helpers
This commit is contained in:
17
vitest.scoped-config.ts
Normal file
17
vitest.scoped-config.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { defineConfig } from "vitest/config";
|
||||
import baseConfig from "./vitest.config.ts";
|
||||
|
||||
export function createScopedVitestConfig(include: string[]) {
|
||||
const base = baseConfig as unknown as Record<string, unknown>;
|
||||
const baseTest = (baseConfig as { test?: { exclude?: string[] } }).test ?? {};
|
||||
const exclude = baseTest.exclude ?? [];
|
||||
|
||||
return defineConfig({
|
||||
...base,
|
||||
test: {
|
||||
...baseTest,
|
||||
include,
|
||||
exclude,
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user