Files
openclaw/src/system-agent/system-agent.runtime.test-support.ts
Peter Steinberger 23c7981a73 test(system-agent): reduce suite setup overhead (#119424)
* 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>
2026-08-04 20:08:53 -07:00

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}`);
},
},
};
}