Skip to content

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.

TypeScript
864 B
Raw Blame
import { describe, expect, test, tier } from 'claude-code/testing'

import Fixtures from '../../fixtures'

tier('builtin')

describe('repository-of', () => {
  test('three absolute lines are the repository', async () => {
    expect(await Fixtures.probedRepositoryOf(Fixtures.RESOLVED)).toEqual({
      toplevel: '/r',
      gitDir: '/r/.git/worktrees/w',
      commonDir: '/r/.git',
    })

    expect(await Fixtures.probedRepositoryOf(Fixtures.WINDOWS)).toEqual({
      toplevel: 'C:/r',
      gitDir: 'C:/r/.git',
      commonDir: 'C:/r/.git',
    })
  })

  test('a git that echoes the flag, or a relative path: nothing', async () => {
    expect(await Fixtures.probedRepositoryOf(Fixtures.ECHOED_FLAG)).toBeNull()
    expect(await Fixtures.probedRepositoryOf(Fixtures.RELATIVE)).toBeNull()
    expect(await Fixtures.probedRepositoryOf('')).toBeNull()
  })
})