test: dedupe heartbeat and action-runner fixtures

This commit is contained in:
Peter Steinberger
2026-02-19 13:59:27 +00:00
parent 26c9b37f5b
commit cb6b835a49
5 changed files with 93 additions and 114 deletions

View File

@@ -11,6 +11,7 @@ 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 } from "./heartbeat-runner.test-utils.js";
import { enqueueSystemEvent, resetSystemEventsForTest } from "./system-events.js";
// Avoid pulling optional runtime deps during isolated runs.
@@ -50,22 +51,11 @@ describe("Ghost reminder bug (issue #13317)", () => {
};
const sessionKey = resolveMainSessionKey(cfg);
await fs.writeFile(
storePath,
JSON.stringify(
{
[sessionKey]: {
sessionId: "sid",
updatedAt: Date.now(),
lastChannel: "telegram",
lastProvider: "telegram",
lastTo: "155462274",
},
},
null,
2,
),
);
await seedSessionStore(storePath, sessionKey, {
lastChannel: "telegram",
lastProvider: "telegram",
lastTo: "155462274",
});
return { cfg, sessionKey };
};