import type { PublicMethodsOf } from '@osd/utility-types' ; import { ContextService , ContextSetup } from './context_service' ; import { contextMock } from '../../utils/context.mock' ; const createSetupContractMock = ( ) => { const setupContract = { createContextContainer : jest . fn ( ) . mockImplementation ( ( ) => contextMock . create ( ) ) , } ; return setupContract ; } ; type ContextServiceContract = PublicMethodsOf < ContextService > ; const createMock = ( ) => { const mocked = { setup : jest . fn ( ) , } ; mocked . setup . mockReturnValue ( createSetupContractMock ( ) ) ; return mocked ; } ; export const contextServiceMock = { create : createMock , createSetupContract : createSetupContractMock , } ;