claude plugin test: test $ lacks nouns the plugin adds in engine.create

Status Open
Reported on v2.1.291
Maintainer reply None cached
Activity 0 comments · opened Oct 6, 2026

In claude plugin test, the test $ has no noun that the plugin under test adds in its own engine.create hook, so the noun and its events can't be tested. Claude Code 2.1.291.

The plugin adds the noun with the documented post-order pattern:

on('engine.create', async (_$, e, next) => ({ ...(await next(e)), prismantis: { markdown: async () => undefined } }))
on('prismantis.markdown', ($, e, next) => { /* draws */ })

and declares it in its types contract (declare module 'claude-code' { interface EngineInterface { prismantis: Prismantis<RenderSurface, RenderElement> } }).

Test, run with claude plugin test .:

test('noun', async ($, on) => {
  mock.env(on, {})
  on('prompt.submit', (_, e) => ({ text: e.text, context: e.context }))
  await $.prompt.submit({ text: 'hi', wait: false, origin: { kind: 'composer' } })
  await $.prismantis.markdown({ surface: 'terminal', text: '# hi', columns: 40 })
})
// TypeError: undefined is not an object (evaluating '$.prismantis.markdown')

The core call succeeds first, so plugins are loaded; $.prismantis is still undefined.

Expected: the test $ exposes nouns added by the plugin's engine.create hook and dispatches their events through its registered hooks, or the docs say how to set that up.

Context: https://github.com/NahumLitvin/prismantis/pull/38

View original on GitHub ↗