Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

711 B
Raw Blame
import { expect } from 'vitest'

import { gitTest } from '../../setup.js'
import { cleanupBaseDir, createBaseDir, createRepo } from './helpers.js'

gitTest('git add stages files', async ({ sandbox }) => {
  const baseDir = await createBaseDir(sandbox)

  try {
    const repoPath = await createRepo(sandbox, baseDir)
    await sandbox.files.write(`${repoPath}/README.md`, 'hello\n')

    await sandbox.git.add(repoPath)

    const status = await sandbox.git.status(repoPath)
    const entry = status.fileStatus.find(
      (file: any) => file.name === 'README.md'
    )
    expect(entry?.status).toBe('added')
    expect(entry?.staged).toBe(true)
  } finally {
    await cleanupBaseDir(sandbox, baseDir)
  }
})