import type { PublicMethodsOf } from '@osd/utility-types' ; import { PluginsService , PluginsServiceSetup } from './plugins_service' ; const createSetupContractMock = ( ) => { const setupContract = { contracts : new Map ( ) , } ; return setupContract as PluginsServiceSetup ; } ; const createStartContractMock = ( ) => { const startContract = { contracts : new Map ( ) , } ; return startContract as PluginsServiceSetup ; } ; type PluginsServiceContract = PublicMethodsOf < PluginsService > ; const createMock = ( ) => { const mocked = { getOpaqueIds : jest . fn ( ) , setup : jest . fn ( ) , start : jest . fn ( ) , stop : jest . fn ( ) , } ; mocked . setup . mockResolvedValue ( createSetupContractMock ( ) ) ; mocked . start . mockResolvedValue ( createStartContractMock ( ) ) ; return mocked ; } ; export const pluginsServiceMock = { create : createMock , createSetupContract : createSetupContractMock , createStartContract : createStartContractMock , } ;