Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @midwayjs/mock

References

BaseMockApplication

BaseMockApplication:

EggMock

EggMock:

MidwayApplicationOptions

MidwayApplicationOptions:

MidwayMockApplication

MidwayMockApplication:

MidwayMockContext

MidwayMockContext:

MidwaySocketIOClientOptions

MidwaySocketIOClientOptions:

MockApplication

MockApplication:

MockClassFunctionHandler

MockClassFunctionHandler:

MockOption

MockOption:

SocketIOWrapperClient

SocketIOWrapperClient:

close

close:

create

create:

createApp

createApp:

createBootstrap

createBootstrap:

createFunctionApp

createFunctionApp:

createHttpRequest

createHttpRequest:

createRabbitMQProducer

createRabbitMQProducer:

createSocketIOClient

createSocketIOClient:

Type aliases

EggContext

EggContext: ReturnType<MockApplication["mockContext"]>
deprecated

MockAppConfigurationOptions

MockAppConfigurationOptions: object

Type declaration

  • Optional baseDir?: string
  • Optional cleanLogsDir?: boolean
  • Optional cleanTempDir?: boolean
  • Optional entryFile?: string

MockClassFunctionHandler

MockClassFunctionHandler: function
deprecated

Type declaration

MockHttpClientResult

MockHttpClientResult: ResultObject | ResultFunction | string

ResultFunction

ResultFunction: function

Type declaration

    • Parameters

      • Optional url: string
      • Optional opts: any

      Returns ResultObject | string | void

Variables

Const EventEmitter

EventEmitter: any = require('events').EventEmitter

Const appMap

appMap: WeakMap<object, any> = new WeakMap()

Const bootstrapAppSet

bootstrapAppSet: Set<object> = (global['MIDWAY_BOOTSTRAP_APP_SET'] = new Set<{framework: IMidwayFramework<any, any>;starter: BootstrapStarter;}>())

Const debug

debug: function = debuglog('midway:mock')

Type declaration

    • (msg: string, ...param: any[]): void
    • Parameters

      • msg: string
      • Rest ...param: any[]

      Returns void

Const eventListeners

eventListeners: any[] = []

Const exchanges

exchanges: object

Type declaration

Let lastAppDir

lastAppDir: any

Const queues

queues: object

Type declaration

Functions

close

  • close(app: IMidwayApplication | IMidwayFramework<any, any>, options?: object): Promise<void>
  • Parameters

    • app: IMidwayApplication | IMidwayFramework<any, any>
    • Optional options: object
      • Optional cleanLogsDir?: boolean
      • Optional cleanTempDir?: boolean
      • Optional sleep?: number

    Returns Promise<void>

Const connect

  • connect(): Promise<object>

create

createApp

createBootstrap

Const createChannel

  • createChannel(): Promise<object>

Const createConfirmChannel

  • createConfirmChannel(): Promise<object>

Const createConfirmQueue

  • createConfirmQueue(): object

Const createDirectExchange

  • createDirectExchange(): object

Const createFanoutExchange

  • createFanoutExchange(): object

createFunctionApp

Const createHeadersExchange

  • createHeadersExchange(): object

createHttpRequest

  • createHttpRequest(app: IMidwayApplication): SuperTest<Test>

Const createQueue

  • createQueue(): object

Const createRabbitMQProducer

  • createRabbitMQProducer(queueName: string, options?: object): Promise<Channel>
  • Parameters

    • queueName: string
    • Default value options: object = {mock: true,}
      • Optional isConfirmChannel?: boolean
      • Optional mock?: boolean
      • Optional url?: string

    Returns Promise<Channel>

createSocketIOClient

formatPath

  • formatPath(baseDir: any, p: any): any

getIncludeFramework

  • getIncludeFramework(dependencies: any): string

isTestEnvironment

  • isTestEnvironment(): boolean

isWin32

  • isWin32(): boolean

Const mockClassFunction

Generated using TypeDoc