跳到主要内容
版本:Next

MidwayMockService

Index

Constructors

constructor

Properties

readonlyapplicationContext

applicationContext: IMidwayContainer

staticprepareMocks

prepareMocks: any[] = []

Methods

applyContextMocks

getContextMocksSize

  • getContextMocksSize(): number

init

  • init(): Promise<void>

publicinitSimulation

  • initSimulation(): Promise<void>

isMocked

  • isMocked(obj: any, key: any): any

publicmockClassProperty

  • mockClassProperty(clzz: new (...args: any[]) => any, propertyName: string, value: any): void

publicmockContext

publicmockProperty

  • mockProperty(obj: any, key: string, value: any): void

restore

  • restore(): void

publicrunSimulatorAppSetup

publicrunSimulatorAppTearDown

publicrunSimulatorContextSetup

publicrunSimulatorContextTearDown

publicrunSimulatorSetup

  • runSimulatorSetup(): Promise<void>

publicrunSimulatorTearDown

  • runSimulatorTearDown(): Promise<void>

staticmockClassProperty

  • mockClassProperty(clzz: new (...args: any[]) => any, propertyName: string, value: any): void

staticmockProperty

  • mockProperty(obj: new (...args: any[]) => any, key: string, value: any): void