88 vi ,
99} from "vitest" ;
1010import { createTestAbsurd , randomName , type TestContext } from "./setup.js" ;
11- import type { Absurd } from "../src/index.js" ;
11+ import { Temporal , type Absurd } from "../src/index.js" ;
1212import { EventEmitter , once } from "events" ;
1313
1414describe ( "Basic SDK Operations" , ( ) => {
@@ -170,7 +170,7 @@ describe("Basic SDK Operations", () => {
170170 const scheduledRun = await ctx . getRun ( runID ) ;
171171 expect ( scheduledRun ) . toMatchObject ( {
172172 state : "sleeping" ,
173- available_at : wakeAt ,
173+ available_at : Temporal . Instant . fromEpochMilliseconds ( wakeAt . getTime ( ) ) ,
174174 wake_event : null ,
175175 } ) ;
176176
@@ -188,7 +188,7 @@ describe("Basic SDK Operations", () => {
188188 const resumedRun = await ctx . getRun ( runID ) ;
189189 expect ( resumedRun ) . toMatchObject ( {
190190 state : "running" ,
191- started_at : wakeAt ,
191+ started_at : Temporal . Instant . fromEpochMilliseconds ( wakeAt . getTime ( ) ) ,
192192 } ) ;
193193 } ) ;
194194
@@ -215,7 +215,7 @@ describe("Basic SDK Operations", () => {
215215 expect ( running ) . toMatchObject ( {
216216 state : "running" ,
217217 claimed_by : "worker-a" ,
218- claim_expires_at : new Date ( baseTime . getTime ( ) + 30 * 1000 ) ,
218+ claim_expires_at : Temporal . Instant . fromEpochMilliseconds ( baseTime . getTime ( ) + 30 * 1000 ) ,
219219 } ) ;
220220
221221 await ctx . setFakeNow ( new Date ( baseTime . getTime ( ) + 5 * 60 * 1000 ) ) ;
@@ -274,7 +274,7 @@ describe("Basic SDK Operations", () => {
274274 const runRow = await ctx . getRun ( runID ) ;
275275 expect ( runRow ) . toMatchObject ( {
276276 claimed_by : "worker-clean" ,
277- claim_expires_at : new Date ( base . getTime ( ) + 60 * 1000 ) ,
277+ claim_expires_at : Temporal . Instant . fromEpochMilliseconds ( base . getTime ( ) + 60 * 1000 ) ,
278278 } ) ;
279279
280280 const beforeTTL = new Date ( finishTime . getTime ( ) + 30 * 60 * 1000 ) ;
@@ -481,7 +481,7 @@ describe("Basic SDK Operations", () => {
481481
482482 const getExpiresAt = async ( runID : string ) => {
483483 const run = await ctx . getRun ( runID ) ;
484- return run ?. claim_expires_at ? run . claim_expires_at . getTime ( ) : 0 ;
484+ return run ?. claim_expires_at ? run . claim_expires_at . epochMilliseconds : 0 ;
485485 } ;
486486
487487 absurd . workBatch ( "test-worker" , claimTimeout ) ;
0 commit comments