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,7 +1,6 @@
import type { IncomingMessage, ServerResponse } from "node:http";
import SlackBolt from "@slack/bolt";
import type { SessionScope } from "../../config/sessions.js";
import type { RuntimeEnv } from "../../runtime.js";
import type { MonitorSlackOpts } from "./types.js";
import { resolveTextChunkLimit } from "../../auto-reply/chunk.js";
import { DEFAULT_GROUP_HISTORY_LIMIT } from "../../auto-reply/reply/history.js";
@@ -10,6 +9,7 @@ import { loadConfig } from "../../config/config.js";
import { warn } from "../../globals.js";
import { installRequestBodyLimitGuard } from "../../infra/http-body.js";
import { normalizeMainKey } from "../../routing/session-key.js";
import { createNonExitingRuntime, type RuntimeEnv } from "../../runtime.js";
import { resolveSlackAccount } from "../accounts.js";
import { resolveSlackWebClientOptions } from "../client.js";
import { normalizeSlackWebhookPath, registerSlackHttpHandler } from "../http/index.js";
@@ -81,13 +81,7 @@ export async function monitorSlackProvider(opts: MonitorSlackOpts = {}) {
);
}
const runtime: RuntimeEnv = opts.runtime ?? {
log: console.log,
error: console.error,
exit: (code: number): never => {
throw new Error(`exit ${code}`);
},
};
const runtime: RuntimeEnv = opts.runtime ?? createNonExitingRuntime();
const slackCfg = account.config;
const dmConfig = slackCfg.dm;