perf(test): gate monitor runtime logs during vitest

This commit is contained in:
Peter Steinberger
2026-02-14 01:14:51 +00:00
parent 643288fda8
commit 54a242eaad
5 changed files with 41 additions and 36 deletions

View File

@@ -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>) {