Skip to content

Installation

Install

Terminal window
npm install --save-dev @gfargo/git-scenarios simple-git
# or
yarn add --dev @gfargo/git-scenarios simple-git
# or
pnpm add --save-dev @gfargo/git-scenarios simple-git

simple-git is a peer dependency — installed alongside so your project picks the version compatible with both this package and any other simple-git consumer you have.

Requirements

  • Node.js: ^22.22.2 || ^24.15.0 || >=26.0.0
  • Git: Any modern version (2.25+ recommended for sparse checkout support)

Module format

The package ships both CJS and ESM. Use import or require — both work:

// ESM
import { spinUpScenario } from '@gfargo/git-scenarios'
// CJS
const { spinUpScenario } = require('@gfargo/git-scenarios')

Package exports

SubpathWhat it provides
@gfargo/git-scenariosMain API: spinUpScenario, fromScenario, createTempGitRepo, assertRepo, snapshotRepo, all atoms, all scenarios, registry
@gfargo/git-scenarios/atomsAtom layer only (tree-shakeable)
@gfargo/git-scenarios/scenariosScenario registry only
@gfargo/git-scenarios/tempGitRepoLow-level createTempGitRepo only
@gfargo/git-scenarios/matchersJest/Vitest expect(...) matchers (toBeMidMerge, toHaveConflictIn, …)
@gfargo/git-scenarios/captureProgrammatic capture helpers (gatherRepoState, renderScenarioModule, …)
@gfargo/git-scenarios/jestJest framework adapter (describeWithScenario)
@gfargo/git-scenarios/vitestVitest framework adapter (same shape as Jest)
@gfargo/git-scenarios/node-testNode.js native test runner adapter (node:test)
@gfargo/git-scenarios/mochaMocha framework adapter
@gfargo/git-scenarios/avaAVA framework adapter (withScenario handle pattern)
@gfargo/git-scenarios/playwrightPlaywright fixture (test.extend) for E2E tests
@gfargo/git-scenarios/cypressCypress task helper for E2E tests
@gfargo/git-scenarios/mocksMock factories for simple-git types (StatusResult, LogResult, BranchSummary, DiffResult) — zero runtime deps
@gfargo/git-scenarios/mcpModel Context Protocol server (programmatic access)

TypeScript

The package is TypeScript-first — all public APIs ship with full type declarations and source maps. No additional @types/ package needed.