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
| 1 | import { describe, expect, test, tier } from 'claude-code/testing' |
| 2 | |
| 3 | import Git from '../hooks/git' |
| 4 | import Fixtures from './fixtures' |
| 5 | |
| 6 | tier('builtin') |
| 7 | |
| 8 | describe('git', () => { |
| 9 | test('each git child names the pin, in the C locale', async ($, on) => { |
| 10 | const world = Fixtures.inRepository(on, Fixtures.oneSecret()) |
| 11 | |
| 12 | await $.session.start(Fixtures.WORKTREE_SESSION) |
| 13 | await $.command.run(Fixtures.DIFF) |
| 14 | await world.clock.advance(Fixtures.SETTLE_MS) |
| 15 | await $.ui.render(Fixtures.PANE) |
| 16 | await $.ui.press({ plugin: 'diff', key: 'ask' }) |
| 17 | await world.clock.settle() |
| 18 | |
| 19 | const [discovery, ...pinned] = world.runs |
| 20 | const diffs = pinned.filter(run => run.argv.includes('diff')) |
| 21 | |
| 22 | expect(discovery?.argv).toContain('--show-toplevel') |
| 23 | expect(discovery?.init?.cwd).toBeUndefined() |
| 24 | expect(diffs.length).toBeGreaterThanOrEqual(3) |
| 25 | |
| 26 | for (const run of world.runs) { |
| 27 | expect(run.init?.env).toEqual(Git.GIT_CHILD_ENV) |
| 28 | } |
| 29 | |
| 30 | for (const run of pinned) { |
| 31 | expect(run.argv.slice(0, Fixtures.PINNED_LEAD.length)).toEqual( |
| 32 | Fixtures.PINNED_LEAD, |
| 33 | ) |
| 34 | |
| 35 | expect(run.init).toMatchObject({ cwd: '/main/wt' }) |
| 36 | } |
| 37 | |
| 38 | expect(world.runs.some(run => run.argv.includes('config'))).toBe(false) |
| 39 | }) |
| 40 | }) |