Class MockMeetingBotProvider

A provider for tests: it records dispatches and commands, and its reports are driven by the test through mockEventContext.

Implements

Constructors

Methods

  • Sends a command to the run's bot. A provider passes on no audio of a run before the run's first startCapture, and none after a suspendCapture until the next startCapture: the manager sends startCapture only once the run's notice is confirmed posted and its stop monitor is healthy.

    Parameters

    Returns Promise<void>

  • Deletes a provider's own copies of a run. Ours keep none; the method stands so a purge always has an answer.

    Parameters

    • input: {
          runId: string;
      }
      • runId: string

    Returns Promise<{
        deleted: boolean;
    }>

Properties

name: "mock" = 'mock'

The name the manager registers the provider under; runs and reports carry it.

platforms: readonly MeetingPlatform[] = ...

The platforms the provider joins.

capabilities: MeetingBotCapabilities = ...

What the provider declares about itself; the notice and the stop path follow from it.

dispatched: Map<string, DispatchInput> = ...

Each run's dispatch input, by run id.

commands: Map<string, ProviderCommand[]> = ...

Each run's commands, in the order they were sent.

deleted: string[] = []

The run ids deleteRun was called with, in order.

alive: Map<string, number> = ...

What usage() answers; tests set it.

dispatchError: undefined | Error

When set, dispatch rejects with it (a worker with no slot).

usageError: undefined | Error

When set, usage() rejects with it: a scheduler that cannot be reached.

commandError: undefined | Error

When set, command() records the command and then rejects with it.

beforeDispatch: undefined | ((input) => Promise<void>)

Runs inside dispatch, before it records anything: a test puts a race here (a cancel while the dispatch is in flight).

Type declaration

    • (input): Promise<void>
    • Parameters

      Returns Promise<void>