























@@ -128,8 +128,10 @@ describe("CronService read ops while job is running", () => {
128128await isolatedRun.runStarted;
129129expect(isolatedRun.runIsolatedAgentJob).toHaveBeenCalledTimes(1);
130130131-await expect(cron.list({ includeDisabled: true })).resolves.toBeTypeOf("object");
132-await expect(cron.status()).resolves.toBeTypeOf("object");
131+await expect(cron.list({ includeDisabled: true })).resolves.toHaveLength(1);
132+await expect(cron.status()).resolves.toEqual(
133+expect.objectContaining({ enabled: true, storePath: store.storePath }),
134+);
133135134136const running = await cron.list({ includeDisabled: true });
135137expect(running[0]?.state.runningAtMs).toBeTypeOf("number");
@@ -197,7 +199,7 @@ describe("CronService read ops while job is running", () => {
197199198200await expect(
199201withTimeout(cron.list({ includeDisabled: true }), 300, "cron.list during cron.run"),
200-).resolves.toBeTypeOf("object");
202+).resolves.toHaveLength(1);
201203await expect(withTimeout(cron.status(), 300, "cron.status during cron.run")).resolves.toEqual(
202204expect.objectContaining({ enabled: true, storePath: store.storePath }),
203205);
@@ -258,7 +260,7 @@ describe("CronService read ops while job is running", () => {
258260259261await expect(
260262withTimeout(cron.list({ includeDisabled: true }), 300, "cron.list during startup"),
261-).resolves.toBeTypeOf("object");
263+).resolves.toHaveLength(1);
262264await expect(withTimeout(cron.status(), 300, "cron.status during startup")).resolves.toEqual(
263265expect.objectContaining({ enabled: true, storePath: store.storePath }),
264266);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。