chore: Fix types in tests 13/N.

This commit is contained in:
cpojer
2026-02-17 11:58:39 +09:00
parent 81fd771cb9
commit 50fd2a99ba
15 changed files with 43 additions and 40 deletions

View File

@@ -26,7 +26,7 @@ describe("trigger handling", () => {
const targetSessionKey = "agent:main:telegram:group:123";
const targetSessionId = "session-target";
await fs.writeFile(
cfg.session.store,
cfg.session!.store,
JSON.stringify(
{
[targetSessionKey]: {
@@ -85,7 +85,7 @@ describe("trigger handling", () => {
const text = Array.isArray(res) ? res[0]?.text : res?.text;
expect(text).toBe("⚙️ Agent was aborted.");
expect(getAbortEmbeddedPiRunMock()).toHaveBeenCalledWith(targetSessionId);
const store = loadSessionStore(cfg.session.store);
const store = loadSessionStore(cfg.session!.store);
expect(store[targetSessionKey]?.abortedLastRun).toBe(true);
expect(getFollowupQueueDepth(targetSessionKey)).toBe(0);
});
@@ -98,7 +98,7 @@ describe("trigger handling", () => {
// Seed the target session to ensure the native command mutates it.
await fs.writeFile(
cfg.session.store,
cfg.session!.store,
JSON.stringify(
{
[targetSessionKey]: {
@@ -131,7 +131,7 @@ describe("trigger handling", () => {
const text = Array.isArray(res) ? res[0]?.text : res?.text;
expect(text).toContain("Model set to openai/gpt-4.1-mini");
const store = loadSessionStore(cfg.session.store);
const store = loadSessionStore(cfg.session!.store);
expect(store[targetSessionKey]?.providerOverride).toBe("openai");
expect(store[targetSessionKey]?.modelOverride).toBe("gpt-4.1-mini");
expect(store[slashSessionKey]).toBeUndefined();