import { Observable , Subject } from 'rxjs' ; import { TaskClaim } from '../task_events' ; import { TaskClaiming } from './task_claiming' ; interface TaskClaimingOptions { maxAttempts ? : number ; taskManagerId ? : string ; events ? : Observable < TaskClaim > ; } export const taskClaimingMock = { create ( { maxAttempts = 0 , taskManagerId = '' , events = new Subject < TaskClaim > ( ) , } ) { const mocked = { claimAvailableTasks : jest . fn ( ) , claimAvailableTasksIfCapacityIsAvailable : jest . fn ( ) , maxAttempts , taskManagerId , events , } as unknown as jest . Mocked < TaskClaiming > ; return mocked ; } , } ;