mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 09:51:36 +00:00
refactor(test): centralize trigger and cron test helpers
This commit is contained in:
11
src/test-utils/model-fallback.mock.ts
Normal file
11
src/test-utils/model-fallback.mock.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export async function runWithModelFallback(params: {
|
||||
provider: string;
|
||||
model: string;
|
||||
run: (provider: string, model: string) => Promise<unknown>;
|
||||
}) {
|
||||
return {
|
||||
result: await params.run(params.provider, params.model),
|
||||
provider: params.provider,
|
||||
model: params.model,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user