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.ts
20 lines · 398 BRaw
1import type { On } from 'claude-code'
2
3/**
4 * Answers every `$.ui.log` beneath the plugins and keeps each line as
5 * `<to>: <text>`, in order.
6 *
7 * @param on the test's `on`
8 * @returns the lines logged so far
9 */
10export function logged(on: On) {
11 const lines: string[] = []
12
13 on('ui.log', ($, e) => {
14 lines.push(`${e.to}: ${e.text}`)
15
16 return { value: undefined }
17 })
18
19 return lines
20}