spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / sec-default / tests / fixtures / logged-by.ts
GitHub Actions (publish-mods)chore: Update mods/ 3deb873 · 14 days ago History
20 lines · 454 BRaw
1import type { On } from 'claude-code'
2
3/**
4 * Answers every `$.ui.log` beneath the plugins and keeps each line as
5 * `<plugin> <text>`, the plugin as the engine pins the caller.
6 *
7 * @param on the test's `on`
8 * @returns the lines logged so far
9 */
10export function loggedBy(on: On) {
11 const lines: string[] = []
12
13 on('ui.log', ($, e, next) => {
14 lines.push(`${next.origin.plugin} ${e.text}`)
15
16 return { value: undefined }
17 })
18
19 return lines
20}