mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 21:38:25 +00:00
refactor(test): centralize trigger and cron test helpers
This commit is contained in:
@@ -1,16 +1,12 @@
|
||||
import fs from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { telegramPlugin } from "../../extensions/telegram/src/channel.js";
|
||||
import { setTelegramRuntime } from "../../extensions/telegram/src/runtime.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { resolveMainSessionKey } from "../config/sessions.js";
|
||||
import { setActivePluginRegistry } from "../plugins/runtime.js";
|
||||
import { createPluginRuntime } from "../plugins/runtime/index.js";
|
||||
import { createTestRegistry } from "../test-utils/channel-plugins.js";
|
||||
import { runHeartbeatOnce } from "./heartbeat-runner.js";
|
||||
import {
|
||||
seedSessionStore,
|
||||
setupTelegramHeartbeatPluginRuntimeForTests,
|
||||
withTempTelegramHeartbeatSandbox,
|
||||
} from "./heartbeat-runner.test-utils.js";
|
||||
|
||||
@@ -18,11 +14,7 @@ import {
|
||||
vi.mock("jiti", () => ({ createJiti: () => () => ({}) }));
|
||||
|
||||
beforeEach(() => {
|
||||
const runtime = createPluginRuntime();
|
||||
setTelegramRuntime(runtime);
|
||||
setActivePluginRegistry(
|
||||
createTestRegistry([{ pluginId: "telegram", plugin: telegramPlugin, source: "test" }]),
|
||||
);
|
||||
setupTelegramHeartbeatPluginRuntimeForTests();
|
||||
});
|
||||
|
||||
describe("heartbeat transcript pruning", () => {
|
||||
|
||||
Reference in New Issue
Block a user