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 / diff / tests / fixtures / old-files.ts
26 lines · 605 BRaw
1import type { On } from 'claude-code'
2
3/**
4 * Answers `$.fs` over /work holding the named files, MOVED_IN's two when
5 * none is given, each last written at time 0, before any session began.
6 *
7 * @param on the test's `on`
8 * @param names the files /work holds
9 */
10export function oldFiles(
11 on: On,
12 names: readonly string[] = ['old.ts', 'moved.ts'],
13) {
14 on('fs.list', () => ({
15 value: names.map(name => ({
16 name,
17 kind: 'file' as const,
18 size: 2,
19 isLink: false,
20 })),
21 }))
22
23 on('fs.stat', () => ({
24 value: { kind: 'file', size: 2, mtimeMs: 0, isLink: false },
25 }))
26}