























@@ -59,7 +59,7 @@ describe("applyJobPatch", () => {
5959to: "123",
6060});
616162-expect(() => applyJobPatch(job, switchToMainPatch())).not.toThrow();
62+applyJobPatch(job, switchToMainPatch());
6363expect(job.sessionTarget).toBe("main");
6464expect(job.payload.kind).toBe("systemEvent");
6565expect(job.delivery).toBeUndefined();
@@ -71,7 +71,7 @@ describe("applyJobPatch", () => {
7171to: "https://example.invalid/cron",
7272});
737374-expect(() => applyJobPatch(job, switchToMainPatch())).not.toThrow();
74+applyJobPatch(job, switchToMainPatch());
7575expect(job.sessionTarget).toBe("main");
7676expect(job.delivery).toEqual({ mode: "webhook", to: "https://example.invalid/cron" });
7777});
@@ -92,7 +92,7 @@ describe("applyJobPatch", () => {
9292},
9393};
949495-expect(() => applyJobPatch(job, patch)).not.toThrow();
95+applyJobPatch(job, patch);
9696expect(job.payload.kind).toBe("agentTurn");
9797if (job.payload.kind === "agentTurn") {
9898expect(job.payload.message).toBe("do it");
@@ -391,7 +391,7 @@ describe("applyJobPatch", () => {
391391to: " https://example.invalid/failure ",
392392},
393393};
394-expect(() => applyJobPatch(job, { enabled: true })).not.toThrow();
394+applyJobPatch(job, { enabled: true });
395395expect(job.delivery?.failureDestination?.to).toBe("https://example.invalid/failure");
396396});
397397@@ -402,7 +402,7 @@ describe("applyJobPatch", () => {
402402to: "-10012345/6789",
403403});
404404405-expect(() => applyJobPatch(job, { enabled: true })).not.toThrow();
405+applyJobPatch(job, { enabled: true });
406406expect(job.delivery?.to).toBe("-10012345/6789");
407407});
408408@@ -421,7 +421,8 @@ describe("applyJobPatch", () => {
421421 ...(to ? { to } : {}),
422422});
423423424-expect(() => applyJobPatch(job, { enabled: true })).not.toThrow();
424+applyJobPatch(job, { enabled: true });
425+expect(job.enabled).toBe(true);
425426});
426427});
427428@@ -453,7 +454,8 @@ describe("createJob rejects sessionTarget main for non-default agents", () => {
453454{ name: "case-insensitive defaultAgentId match", defaultAgentId: "Main", agentId: "MAIN" },
454455] as const)("allows creating a main-session job for $name", ({ defaultAgentId, agentId }) => {
455456const state = createMockState(now, { defaultAgentId });
456-expect(() => createJob(state, mainJobInput(agentId))).not.toThrow();
457+const job = createJob(state, mainJobInput(agentId));
458+expect(job.sessionTarget).toBe("main");
457459});
458460459461it.each([
@@ -544,7 +546,8 @@ describe("applyJobPatch rejects sessionTarget main for non-default agents", () =
544546);
545547return;
546548}
547-expect(() => applyJobPatch(job, patch, { defaultAgentId: "main" })).not.toThrow();
549+applyJobPatch(job, patch, { defaultAgentId: "main" });
550+expect(job.agentId).toBe("main");
548551});
549552550553it("rejects patching to a custom session target with path separators", () => {
@@ -941,7 +944,7 @@ describe("recomputeNextRuns", () => {
941944store: { version: 1 as const, jobs: [job] },
942945} as CronServiceState;
943946944-expect(() => recomputeNextRunsForMaintenance(state)).not.toThrow();
947+recomputeNextRunsForMaintenance(state);
945948expect(job.state.nextRunAtMs).toBe(future);
946949expect(job.state.scheduleErrorCount).toBeUndefined();
947950});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。