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
event: "mock-session-started"
listener: ((plugins, sessionId) => void)
(plugins, sessionId): void
Parameters
plugins: Plugins
sessionId: string
Returns void
Returns void
on(event, listener): 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
event: "mock-session-stopping"
listener: ((plugins, sessionId) => void)
(plugins, sessionId): void
Parameters
plugins: Plugins
sessionId: string
Returns void
Returns void
resetAdminServer
resetAdminServer(): Promise<void>
Returns Promise<void>
start
start(listenOptions?): Promise<void>
Parameters
OptionallistenOptions: number | { host: string; port: number; }
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.