test(release): unblock beta validation checks · openclaw/openclaw@37e3e89
vincentkoc
·
2026-06-14
·
via Recent Commits to openclaw:main
File tree
extensions/feishu/src/test-support
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3,7 +3,7 @@ import { randomUUID } from "node:crypto";
|
3 | 3 | import { createPluginRuntimeMock } from "openclaw/plugin-sdk/channel-test-helpers"; |
4 | 4 | import { expect, vi, type Mock } from "vitest"; |
5 | 5 | import type { ClawdbotConfig, PluginRuntime, RuntimeEnv } from "../../runtime-api.js"; |
6 | | -import { setFeishuRuntime } from "../runtime.js"; |
| 6 | +import { getFeishuRuntime, setFeishuRuntime } from "../runtime.js"; |
7 | 7 | import type { ResolvedFeishuAccount } from "../types.js"; |
8 | 8 | |
9 | 9 | const FEISHU_LIFECYCLE_WAIT_TIMEOUT_MS = 10_000; |
@@ -437,6 +437,9 @@ export async function setupFeishuLifecycleHandler(params: {
|
437 | 437 | } else { |
438 | 438 | params.createEventDispatcherMock.mockReturnValue({ register }); |
439 | 439 | } |
| 440 | +getFeishuRuntime().config.current = vi.fn( |
| 441 | +() => params.cfg, |
| 442 | +) as unknown as PluginRuntime["config"]["current"]; |
440 | 443 | |
441 | 444 | const monitorSingleAccount = await loadMonitorSingleAccount(); |
442 | 445 | await monitorSingleAccount({ |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -371,7 +371,7 @@ export async function resolveSessionTranscriptResetArchiveCandidatesAsync(
|
371 | 371 | ).flatMap((identityArchives) => |
372 | 372 | identityArchives |
373 | 373 | .flatMap((archive) => (archive ? [archive] : [])) |
374 | | -.sort( |
| 374 | +.toSorted( |
375 | 375 | (left, right) => right.timestamp - left.timestamp || right.name.localeCompare(left.name), |
376 | 376 | ) |
377 | 377 | .slice(0, 1), |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -839,7 +839,7 @@ describe("readSessionMessages", () => {
|
839 | 839 | ]); |
840 | 840 | clearSessionTranscriptIndexCache(); |
841 | 841 | |
842 | | -const originalReaddir = fs.promises.readdir.bind(fs.promises) as typeof fs.promises.readdir; |
| 842 | +const originalReaddir = fs.promises.readdir.bind(fs.promises); |
843 | 843 | let wroteActiveTranscript = false; |
844 | 844 | const readdirSpy = vi.spyOn(fs.promises, "readdir").mockImplementation((async ( |
845 | 845 | ...args: unknown[] |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。