v1.3.0
Mock Factory Layer
New subpath export @gfargo/git-scenarios/mocks — in-memory mock objects matching simple-git's type signatures for fast unit tests. No disk I/O, no git dependency, <1ms per call.
Highlights
- Functional factories:
mockStatusResult(),mockLogResult(),mockBranchSummary(),mockDiffResult() - Fluent builders:
mockStatus().staged('a.ts').modified('b.ts').build() mockSimpleGit(): Proxy-based full SimpleGit stub (jest.fn / vi.fn agnostic)mockFromScenario(): Derive mocks from scenario contracts without running git- Pretty-printers:
printMockStatus(),printMockLog()for debugging - Bucket mapping:
mapXYToBuckets(),bucketsToXY()exposed for advanced use
Install
npm install @gfargo/git-scenarios@1.3.0import { mockStatus, mockSimpleGit } from '@gfargo/git-scenarios/mocks'Zero runtime dependencies — the ./mocks subpath uses only type imports from simple-git.
Docs
Full guide: https://git-scenarios.griffen.codes/docs/guides/mock-factories