diff --git a/src/infra/heartbeat-runner.cron-system-event-filter.test.ts b/src/infra/heartbeat-runner.cron-system-event-filter.test.ts deleted file mode 100644 index dfe4c2c18..000000000 --- a/src/infra/heartbeat-runner.cron-system-event-filter.test.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { describe, expect, it } from "vitest"; -import { isCronSystemEvent } from "./heartbeat-runner.js"; - -describe("isCronSystemEvent", () => { - it("returns false for empty entries", () => { - expect(isCronSystemEvent("")).toBe(false); - expect(isCronSystemEvent(" ")).toBe(false); - }); - - it("returns false for heartbeat ack markers", () => { - expect(isCronSystemEvent("HEARTBEAT_OK")).toBe(false); - expect(isCronSystemEvent("HEARTBEAT_OK 🦞")).toBe(false); - expect(isCronSystemEvent("heartbeat_ok")).toBe(false); - expect(isCronSystemEvent("HEARTBEAT_OK:")).toBe(false); - expect(isCronSystemEvent("HEARTBEAT_OK, continue")).toBe(false); - }); - - it("returns false for heartbeat poll and wake noise", () => { - expect(isCronSystemEvent("heartbeat poll: pending")).toBe(false); - expect(isCronSystemEvent("heartbeat wake complete")).toBe(false); - }); - - it("returns false for exec completion events", () => { - expect(isCronSystemEvent("Exec finished (gateway id=abc, code 0)")).toBe(false); - }); - - it("returns true for real cron reminder content", () => { - expect(isCronSystemEvent("Reminder: Check Base Scout results")).toBe(true); - expect(isCronSystemEvent("Send weekly status update to the team")).toBe(true); - }); -}); diff --git a/src/infra/system-events.test.ts b/src/infra/system-events.test.ts index 03a39cd9e..9175d45c7 100644 --- a/src/infra/system-events.test.ts +++ b/src/infra/system-events.test.ts @@ -2,6 +2,7 @@ import { beforeEach, describe, expect, it } from "vitest"; import type { OpenClawConfig } from "../config/config.js"; import { prependSystemEvents } from "../auto-reply/reply/session-updates.js"; import { resolveMainSessionKey } from "../config/sessions.js"; +import { isCronSystemEvent } from "./heartbeat-runner.js"; import { enqueueSystemEvent, peekSystemEvents, resetSystemEventsForTest } from "./system-events.js"; const cfg = {} as unknown as OpenClawConfig; @@ -46,3 +47,32 @@ describe("system events (session routing)", () => { expect(() => enqueueSystemEvent("Node: Mac Studio", { sessionKey: " " })).toThrow("sessionKey"); }); }); + +describe("isCronSystemEvent", () => { + it("returns false for empty entries", () => { + expect(isCronSystemEvent("")).toBe(false); + expect(isCronSystemEvent(" ")).toBe(false); + }); + + it("returns false for heartbeat ack markers", () => { + expect(isCronSystemEvent("HEARTBEAT_OK")).toBe(false); + expect(isCronSystemEvent("HEARTBEAT_OK 🦞")).toBe(false); + expect(isCronSystemEvent("heartbeat_ok")).toBe(false); + expect(isCronSystemEvent("HEARTBEAT_OK:")).toBe(false); + expect(isCronSystemEvent("HEARTBEAT_OK, continue")).toBe(false); + }); + + it("returns false for heartbeat poll and wake noise", () => { + expect(isCronSystemEvent("heartbeat poll: pending")).toBe(false); + expect(isCronSystemEvent("heartbeat wake complete")).toBe(false); + }); + + it("returns false for exec completion events", () => { + expect(isCronSystemEvent("Exec finished (gateway id=abc, code 0)")).toBe(false); + }); + + it("returns true for real cron reminder content", () => { + expect(isCronSystemEvent("Reminder: Check Base Scout results")).toBe(true); + expect(isCronSystemEvent("Send weekly status update to the team")).toBe(true); + }); +});