




















@@ -23,6 +23,14 @@ async function expectPathMissing(targetPath: string): Promise<void> {
2323}
2424}
252526+function firstNoteCall(): [string, string] {
27+const call = note.mock.calls[0];
28+if (!call) {
29+throw new Error("expected note call");
30+}
31+return call as [string, string];
32+}
33+2634describe("noteSessionLockHealth", () => {
2735let state: OpenClawTestState;
2836@@ -55,7 +63,7 @@ describe("noteSessionLockHealth", () => {
5563});
56645765expect(note).toHaveBeenCalledTimes(1);
58-const [message, title] = note.mock.calls.at(0) as [string, string];
66+const [message, title] = firstNoteCall();
5967expect(title).toBe("Session locks");
6068expect(message).toContain("Found 1 session lock file");
6169expect(message).toContain(`pid=${process.pid} (alive)`);
@@ -88,7 +96,7 @@ describe("noteSessionLockHealth", () => {
8896});
89979098expect(note).toHaveBeenCalledTimes(1);
91-const [message] = note.mock.calls.at(0) as [string, string];
99+const [message] = firstNoteCall();
92100expect(message).toContain("[removed]");
93101expect(message).toContain("Removed 1 stale session lock file");
94102@@ -114,7 +122,7 @@ describe("noteSessionLockHealth", () => {
114122});
115123116124expect(note).toHaveBeenCalledTimes(1);
117-const [message] = note.mock.calls.at(0) as [string, string];
125+const [message] = firstNoteCall();
118126expect(message).toContain("stale=yes (non-openclaw-owner)");
119127expect(message).toContain("[removed]");
120128expect(message).toContain("Removed 1 stale session lock file");
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。