@@ -3,14 +3,15 @@ import os from "node:os";
|
3 | 3 | import path from "node:path"; |
4 | 4 | import type { ChannelAccountSnapshot } from "openclaw/plugin-sdk/channel-contract"; |
5 | 5 | import { MAX_TIMER_TIMEOUT_MS } from "openclaw/plugin-sdk/number-runtime"; |
6 | | -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; |
7 | | -import { createChannelIngressQueue } from "../../../src/channels/message/ingress-queue.js"; |
8 | | -import { executeSqliteQuerySync, getNodeSqliteKysely } from "../../../src/infra/kysely-sync.js"; |
9 | | -import type { DB as OpenClawStateKyselyDatabase } from "../../../src/state/openclaw-state-db.generated.js"; |
10 | 6 | import { |
11 | 7 | closeOpenClawStateDatabaseForTest, |
| 8 | +createChannelIngressQueueForTests as createChannelIngressQueue, |
| 9 | +executeSqliteQuerySync, |
| 10 | +getNodeSqliteKysely, |
12 | 11 | openOpenClawStateDatabase, |
13 | | -} from "../../../src/state/openclaw-state-db.js"; |
| 12 | +type OpenClawStateKyselyDatabaseForTests, |
| 13 | +} from "openclaw/plugin-sdk/plugin-state-test-runtime"; |
| 14 | +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; |
14 | 15 | import { clearTelegramRuntime, setTelegramRuntime } from "./runtime.js"; |
15 | 16 | import type { TelegramRuntime } from "./runtime.types.js"; |
16 | 17 | import type { TelegramIngressWorkerMessage } from "./telegram-ingress-worker.js"; |
@@ -105,7 +106,10 @@ type WorkerPollErrorListener = (message: {
|
105 | 106 | type WorkerMessageListener = (message: TelegramIngressWorkerMessage) => void; |
106 | 107 | type AsyncVoidFn = () => Promise<void>; |
107 | 108 | type MockCallSource = { mock: { calls: Array<Array<unknown>> } }; |
108 | | -type TelegramPollingTestDatabase = Pick<OpenClawStateKyselyDatabase, "channel_ingress_events">; |
| 109 | +type TelegramPollingTestDatabase = Pick< |
| 110 | +OpenClawStateKyselyDatabaseForTests, |
| 111 | +"channel_ingress_events" |
| 112 | +>; |
109 | 113 | |
110 | 114 | const POLLING_TEST_WATCHDOG_INTERVAL_MS = 30_000; |
111 | 115 | |
@@ -115,7 +119,7 @@ function installTelegramIngressQueueRuntime(resolveStateDir: () => string): void
|
115 | 119 | resolveStateDir, |
116 | 120 | openChannelIngressQueue: ( |
117 | 121 | options?: Omit<Parameters<typeof createChannelIngressQueue>[0], "channelId">, |
118 | | -) => createChannelIngressQueue({ ...(options ?? {}), channelId: "telegram" }), |
| 122 | +) => createChannelIngressQueue({ ...options, channelId: "telegram" }), |
119 | 123 | }, |
120 | 124 | } as TelegramRuntime); |
121 | 125 | } |
|