@@ -396,16 +396,16 @@ describe("CronService", () => {
396396 expect ( runHeartbeatOnce ) . toHaveBeenCalledTimes ( 1 ) ;
397397 expect ( requestHeartbeat ) . not . toHaveBeenCalled ( ) ;
398398 expectMainSystemEventPosted ( enqueueSystemEvent , { text : "hello" , jobId : job . id } ) ;
399- expect ( job . state . runningAtMs ) . toBeTypeOf ( "number" ) ;
399+ const running = ( await cron . list ( { includeDisabled : true } ) ) . find (
400+ ( entry ) => entry . id === job . id ,
401+ ) ;
402+ expect ( running ?. state . runningAtMs ) . toBeTypeOf ( "number" ) ;
400403
401404 if ( typeof resolveHeartbeat === "function" ) {
402405 ( resolveHeartbeat as ( res : HeartbeatRunResult ) => void ) ( { status : "ran" , durationMs : 123 } ) ;
403406 }
404407 await runPromise ;
405408
406- expect ( job . state . lastStatus ) . toBe ( "ok" ) ;
407- expect ( job . state . lastDurationMs ) . toBeGreaterThan ( 0 ) ;
408-
409409 await stopCronAndCleanup ( cron , store ) ;
410410 } ) ;
411411
@@ -457,10 +457,6 @@ describe("CronService", () => {
457457
458458 expect ( runHeartbeatOnce ) . toHaveBeenCalled ( ) ;
459459 expectQueuedCronHeartbeat ( requestHeartbeat , { jobId : job . id } ) ;
460- expect ( job . state . lastStatus ) . toBe ( "ok" ) ;
461- expect ( job . state . lastError ) . toBeUndefined ( ) ;
462-
463- await cron . list ( { includeDisabled : true } ) ;
464460 await stopCronAndCleanup ( cron , store ) ;
465461 } ) ;
466462
@@ -484,10 +480,6 @@ describe("CronService", () => {
484480
485481 expect ( runHeartbeatOnce ) . toHaveBeenCalledTimes ( 1 ) ;
486482 expectQueuedCronHeartbeat ( requestHeartbeat , { jobId : job . id } ) ;
487- expect ( job . state . lastStatus ) . toBe ( "ok" ) ;
488- expect ( job . state . lastError ) . toBeUndefined ( ) ;
489-
490- await cron . list ( { includeDisabled : true } ) ;
491483 await stopCronAndCleanup ( cron , store ) ;
492484 } ) ;
493485
0 commit comments