mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 18:18:28 +00:00
perf(test): gate monitor runtime logs during vitest
This commit is contained in:
@@ -1,16 +1,8 @@
|
||||
import type { RuntimeEnv } from "../../runtime.js";
|
||||
import type { MonitorIMessageOpts } from "./types.js";
|
||||
import { createNonExitingRuntime, type RuntimeEnv } from "../../runtime.js";
|
||||
|
||||
export function resolveRuntime(opts: MonitorIMessageOpts): RuntimeEnv {
|
||||
return (
|
||||
opts.runtime ?? {
|
||||
log: console.log,
|
||||
error: console.error,
|
||||
exit: (code: number): never => {
|
||||
throw new Error(`exit ${code}`);
|
||||
},
|
||||
}
|
||||
);
|
||||
return opts.runtime ?? createNonExitingRuntime();
|
||||
}
|
||||
|
||||
export function normalizeAllowList(list?: Array<string | number>) {
|
||||
|
||||
Reference in New Issue
Block a user