mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 05:17:40 +00:00
test: dedupe fixtures and test harness setup
This commit is contained in:
9
src/agents/models-config.test-utils.ts
Normal file
9
src/agents/models-config.test-utils.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import fs from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { resolveOpenClawAgentDir } from "./agent-paths.js";
|
||||
|
||||
export async function readGeneratedModelsJson<T>(): Promise<T> {
|
||||
const modelPath = path.join(resolveOpenClawAgentDir(), "models.json");
|
||||
const raw = await fs.readFile(modelPath, "utf8");
|
||||
return JSON.parse(raw) as T;
|
||||
}
|
||||
Reference in New Issue
Block a user