import type { PublicMethodsOf } from '@osd/utility-types' ; import { LegacyService } from './legacy_service' ; import { LegacyConfig , LegacyServiceSetupDeps } from './types' ; type LegacyServiceMock = jest . Mocked < PublicMethodsOf < LegacyService > & { legacyId : symbol ; } > ; const createLegacyServiceMock = ( ) : LegacyServiceMock => ( { legacyId : Symbol ( ) , setupLegacyConfig : jest . fn ( ) , setup : jest . fn ( ) , start : jest . fn ( ) , stop : jest . fn ( ) , } ) ; const createLegacyConfigMock = ( ) : jest . Mocked < LegacyConfig > => ( { get : jest . fn ( ) , has : jest . fn ( ) , set : jest . fn ( ) , } ) ; export const legacyServiceMock = { create : createLegacyServiceMock , createSetupContract : ( deps ) => createLegacyServiceMock ( ) . setup ( deps ) , createLegacyConfig : createLegacyConfigMock , } ;