Repository navigation
Claude Code Mod API Testing Types 2
xsyetopz edited this page Oct 19, 2026
·
2 revisions
These are more of the types of the claude-code/testing module, which a mod uses to test itself.
They run from MountInputTarget to WithMessage.message, and they include test and MountTarget.
Example: test('greets', { options: { greeting: 'yo' } }, body).
| Mark | Item | What it is for | Shape and limits | Source |
|---|---|---|---|---|
| ✅ | MountInputTarget |
What a mounted drawing's input takes: the Input's key, the text, which of the two inputs it is (submit when unsaid), another plugin's name. |
Object with fields key, text, kind?, plugin?. |
d.ts line 16454 |
| ✅ | MountInputTarget.key |
A field of MountInputTarget. |
Type: string. |
d.ts line 16454 |
| ✅ | MountInputTarget.text |
A field of MountInputTarget. |
Type: string. |
d.ts line 16454 |
| ✅ | MountInputTarget.kind |
A field of MountInputTarget. |
Type: UiInputArgument['kind']. Optional. |
d.ts line 16454 |
| ✅ | MountInputTarget.plugin |
A field of MountInputTarget. |
Type: string. Optional. |
d.ts line 16454 |
| ✅ | MountKeyEvent |
What a mounted drawing's key takes: the key as a Client's onKey listener receives it (ClientKeyEvent), and which Client when several. |
Alias of ClientKeyEvent & ClientScope. |
d.ts line 16465 |
| ✅ | MountPointerEvent |
What a mounted drawing's pointer takes: the event as a Client's onPointer listener receives it, in its region's cells, and which one. |
Alias of ClientPointerEvent & ClientScope. |
d.ts line 16471 |
| ✅ | MountPressTarget |
What a mounted drawing's press takes: the Button's key, another plugin's name when the Button is not the mounted plugin's, a link. |
Object with fields key, plugin?, link?. |
d.ts line 16477 |
| ✅ | MountPressTarget.key |
A field of MountPressTarget. |
Type: string. |
d.ts line 16477 |
| ✅ | MountPressTarget.plugin |
A field of MountPressTarget. |
Type: string. Optional. |
d.ts line 16477 |
| ✅ | MountPressTarget.link |
Presses this link of the Markdown keyed key instead of a Button. |
Type: PressedLink. Optional. |
d.ts line 16477 |
| ✅ | MountResizeTarget |
What a mounted drawing's resize takes: a Client region's size in cells, as the surface measuring it hands it, and which Client. |
Object with fields columns, rows, in?. |
d.ts line 16490 |
| ✅ | MountResizeTarget.columns |
A field of MountResizeTarget. |
Type: number. |
d.ts line 16490 |
| ✅ | MountResizeTarget.rows |
A field of MountResizeTarget. |
Type: number. |
d.ts line 16490 |
| ✅ | MountResizeTarget.in |
A field of MountResizeTarget. |
Type: string. Optional. |
d.ts line 16490 |
| ✅ | MountSelectTarget |
What a mounted drawing's select takes: the Select's key, the picked option's value, another plugin's name when the Select is not its own. |
Object with fields key, value, plugin?. |
d.ts line 16500 |
| ✅ | MountSelectTarget.key |
A field of MountSelectTarget. |
Type: string. |
d.ts line 16500 |
| ✅ | MountSelectTarget.value |
A field of MountSelectTarget. |
Type: string. |
d.ts line 16500 |
| ✅ | MountSelectTarget.plugin |
A field of MountSelectTarget. |
Type: string. Optional. |
d.ts line 16500 |
| ✅ | MountTarget |
What $.ui.mount takes: whose elements the test will act on, the surface that draws, and the component instance the engine asks the plugins for. |
Alias of the target of mount: plugin, surface, component, props, requestId?, viewport?. surface is never defaulted. Run one body over several surfaces. |
d.ts line 16517 |
| ✅ | MountTarget.plugin |
Whose elements the handle's acts address by bare key: the plugin under test, usually. An act names another plugin to reach its element. |
Type: string. |
d.ts line 16517 |
| ✅ | MountTarget.surface |
What draws: its element table validates every tree the plugins return, and every dispatch the handle raises carries it as e.surface. |
Type: P. One of terminal, desktop, vscode, mobile. |
d.ts line 16517 |
| ✅ | MountTarget.component |
Which component the engine asks the plugins to draw (Pane, AbovePrompt, ToolUse, ...): what a ui.render matcher narrows on. |
Type: C. |
d.ts line 16517 |
| ✅ | MountTarget.props |
The component's props, what the hook reads as e.props. |
Type: RenderPropsOf[C]. |
d.ts line 16517 |
| ✅ | MountTarget.requestId |
The instance drawn (a pane's id, a tool row's tool_use_id), one is minted when absent. Two mounts of one component are two instances. | Type: string. Optional. |
d.ts line 16517 |
| ✅ | MountTarget.viewport |
What the surface measured, as the hook reads it under e.viewport, absent when the surface has not measured, as on e. |
Type: RenderViewport. Optional. Cells across and down. A Client starts at this size (0 by 0 when absent) until resize lays it out. |
d.ts line 16517 |
| ✅ | Negatable |
A set of checks and, under not, the same set passing where they fail. |
Intersection with Negatable. Object with fields not. |
d.ts line 16558 |
| ✅ | Negatable.not |
The checks negated. | Type: M. |
d.ts line 16558 |
| ✅ | Plugin |
Written inline in a test and loaded as a plugin folder is: its name, the tier it loads in (user when not given), and its hooks module's register. |
Object with fields name, tier?, register. register is written register(on) { ... } and is self-contained, as a module's is: it closes over nothing of the test file. |
d.ts line 16572 |
| ✅ | Plugin.name |
A field of Plugin. |
Type: string. |
d.ts line 16572 |
| ✅ | Plugin.tier |
A field of Plugin. |
Type: PluginTier. Optional. |
d.ts line 16572 |
| ✅ | Plugin.register |
A field of Plugin. |
Type: Register. |
d.ts line 16572 |
| ✅ | PluginTier |
A tier a plugin loads in: every tier but the engine's own. | Alias of Exclude<Tier, 'core'>. |
d.ts line 16581 |
| ✅ | PressTarget |
What $.ui.press takes: the plugin whose ui.render hook drew the element, the key it gave it, the instance and surface when several, a link. |
Object with fields plugin, key, requestId?, surface?, link?. |
d.ts line 16587 |
| ✅ | PressTarget.plugin |
A field of PressTarget. |
Type: string. |
d.ts line 16587 |
| ✅ | PressTarget.key |
A field of PressTarget. |
Type: string. |
d.ts line 16587 |
| ✅ | PressTarget.requestId |
Which instance holds it, when the plugin drew the key in several. | Type: string. Optional. |
d.ts line 16587 |
| ✅ | PressTarget.surface |
Which surface's drawing, when the key is drawn on more than one, the press carries the surface of the drawing it lands in either way. | Type: RenderSurface. Optional. |
d.ts line 16587 |
| ✅ | PressTarget.link |
For a Markdown answering its links: which of them the press lands on. | Type: PressedLink. Optional. |
d.ts line 16587 |
| ✅ | SelectTarget |
What $.ui.select takes: the plugin whose hook drew the Select, its key, the picked option's value, instance and surface when several. |
Object with fields plugin, key, value, requestId?, surface?. |
d.ts line 16609 |
| ✅ | SelectTarget.plugin |
A field of SelectTarget. |
Type: string. |
d.ts line 16609 |
| ✅ | SelectTarget.key |
A field of SelectTarget. |
Type: string. |
d.ts line 16609 |
| ✅ | SelectTarget.value |
Which option is picked, by the value the Select listed it under. |
Type: string. |
d.ts line 16609 |
| ✅ | SelectTarget.requestId |
Which instance holds it, when the plugin drew the key in several. | Type: string. Optional. |
d.ts line 16609 |
| ✅ | SelectTarget.surface |
Which surface's drawing, when the key is drawn on more than one, the pick carries the surface of the drawing it lands in either way. | Type: RenderSurface. Optional. |
d.ts line 16609 |
| ✅ | test |
One test: it passes when its body returns or resolves, and fails when it throws, rejects or outlasts its time (5000 ms, or timeoutMs). |
Alias of the test function. The body gets the engine's $ and an on whose hooks sit beneath every plugin. A failure lists each hook that was skipped, and why. |
d.ts line 16638 |
| ✅ | TestBody |
A test: the engine's $, and on, a plugin's registrar, whose hooks sit beneath every plugin, beneath them the bottom hook throws, naming its event. |
Alias of ($: Engine, on: On) => unknown. Register hooks before the first call on $, which loads the plugins. A failed check in a hook fails the test. |
d.ts line 16648 |
| ✅ | TestOptions |
What test takes beside its name: the inline plugins it loads beside the one under test, and how long it may run (5000 ms when not given). |
Object with fields plugins?, timeoutMs?, options?. Also the plugin under test's userConfig values. |
d.ts line 16656 |
| ✅ | TestOptions.plugins |
A field of TestOptions. |
Type: readonly Plugin[]. Optional. |
d.ts line 16656 |
| ✅ | TestOptions.timeoutMs |
A field of TestOptions. |
Type: number. Optional. |
d.ts line 16656 |
| ✅ | TestOptions.options |
The plugin under test's userConfig values, standing as the ones stored in settings. |
Type: PluginOptions. Optional. register(on, options) receives them as in a real load, with defaults filled in. Left out, the manifest's defaults apply. |
d.ts line 16656 |
| ✅ | TestRest |
What follows a test's name: its body, or its options then its body. | Alias of readonly [body: TestBody] | readonly [options: TestOptions, body: TestBody]. |
d.ts line 16676 |
| ✅ | ThrowExpectation |
What toThrow compares the thrown error with: a substring or pattern of its message, its class, a value carrying the whole message, or nothing. |
Alias of string | RegExp | Constructor | WithMessage. |
d.ts line 16682 |
| ✅ | tier |
Says which tier the plugin under test loads in, once, at the top of the file: prepend, user (when unsaid), append or builtin. |
Function (tier: PluginTier) => void. Call it once at the top of the test file. |
d.ts line 16690 |
| ✅ | WithMessage |
An error-like value toThrow compares by its whole message. |
Object with fields message. |
d.ts line 16695 |
| ✅ | WithMessage.message |
A field of WithMessage. |
Type: string. |
d.ts line 16695 |
claudetto
- Start
- Slices
- Add-Ons
- Reference
- Rationale
- Evidence
- Development
Claude Code 2.1.303
- Start
- Models and Context
- Configure
- Extend
- Findings