Skip to content
GitHub

ResolvedRoute

interface in meocord/testing Since 4.0.0

interface ResolvedRoute

The handler a component interaction or a message reaches, as resolveRoute reports it.

Members

controller

controller: ControllerClass

The controller class declaring the handler.

method

method: string

The name of the handler method.

handler

handler: (...args: any[]) => unknown

The handler method itself, for assertions that survive renaming it: expect(route?.handler).toBe(ProfileController.prototype.showProfile).

params

params: Record<string, string>

The text the pattern's params captured. A message's typed params are left as their words: dispatch and invoke resolve them against the message's guild.

values Since 4.1.0

values?: Record<string, string | number | boolean>

The params as the handler receives them, for a component route with a typed param: each typed param as its value, such as a number for {count:int}, and the others as their text. Absent for any other route, whose handler receives params.