Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MockttpAdminServer

Hierarchy

Index

Constructors

Accessors

  • get ruleParameterKeys(): string[]

Methods

  • on(event: "mock-session-started", listener: ((plugins: { http: MockttpAdminPlugin }, sessionId: string) => void)): void
  • on(event: "mock-session-stopping", listener: ((plugins: { http: MockttpAdminPlugin }, sessionId: string) => void)): void
  • Subscribe to hear when each mock ession is started. The listener is provided the session plugin data, which can be used to log session startup, add side-effects that run elsewhere at startup, or preconfigure every started plugin in addition ways.

    This is run synchronously when a session is created, after it has fully started but before its been returned to remote clients.

    Parameters

    Returns void

  • Subscribe to hear when a mock session is stopped. The listener is provided with the state of all plugins that are about to be stopped. This can be used to log mock session shutdown, add side-effects that run elsewhere at shutdown, or clean up after sessions in other ways.

    This is run synchronously immediately before the session is shutdown, whilst all its state is still available, and before remote clients have had any response to their request. This is also run before shutdown when the admin server itself is cleanly shutdown with adminServer.stop().

    Parameters

    Returns void

  • resetAdminServer(): Promise<void>
  • start(listenOptions?: number | { host: string; port: number }): Promise<void>
  • stop(): Promise<void>

Generated using TypeDoc