test: align cli runtime mocks with output runtime

This commit is contained in:
Peter Steinberger
2026-03-22 17:29:28 -07:00
parent 7bd12f4b37
commit 976eefe373
15 changed files with 37 additions and 47 deletions

View File

@@ -30,6 +30,12 @@ export function createCliRuntimeCapture(): CliRuntimeCapture {
exit: (code: number) => {
throw new Error(`__exit__:${code}`);
},
writeStdout: (value: string) => {
runtimeLogs.push(value);
},
writeJson: (value: unknown, space = 2) => {
runtimeLogs.push(JSON.stringify(value, null, space > 0 ? space : undefined));
},
},
resetRuntimeCapture: () => {
runtimeLogs.length = 0;