mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-15 07:04:01 -06:00
23c7981a73
* test(system-agent): reduce suite setup overhead * test(system-agent): type-check TUI call ordering --------- Co-authored-by: Peter Steinberger <steipete@mac-studio-sf2.local>
17 lines
469 B
TypeScript
17 lines
469 B
TypeScript
import type { RuntimeEnv } from "../runtime.js";
|
|
|
|
/** Create a RuntimeEnv that records log/error lines for tests. */
|
|
export function createSystemAgentTestRuntime(): { runtime: RuntimeEnv; lines: string[] } {
|
|
const lines: string[] = [];
|
|
return {
|
|
lines,
|
|
runtime: {
|
|
log: (...args) => lines.push(args.join(" ")),
|
|
error: (...args) => lines.push(args.join(" ")),
|
|
exit: (code) => {
|
|
throw new Error(`exit ${code}`);
|
|
},
|
|
},
|
|
};
|
|
}
|