Skip to content

Split test-utils fixture.ts into focused modules#56

Merged
gtbuchanan merged 1 commit intomainfrom
fix/fixture-growth
Apr 22, 2026
Merged

Split test-utils fixture.ts into focused modules#56
gtbuchanan merged 1 commit intomainfrom
fix/fixture-growth

Conversation

@gtbuchanan
Copy link
Copy Markdown
Owner

Summary

  • Break up the ~374-line packages/test-utils/src/fixture.ts into focused modules: lib/command.ts, lib/workspace.ts, lib/tarball.ts, isolated-fixture.ts, project-fixture.ts, with fixture.ts as a thin barrel.
  • Public API unchanged (createIsolatedFixture, createProjectFixture, extendWithFixture, pinned, matchTarball, createGitEnv, runCommand + types).
  • Memo caches split cleanly — workspace root/index in workspace.ts, tarball cache in tarball.ts. No cross-module state.

Closes #55.

Test plan

  • pnpm check (typecheck + lint + fast vitest across all packages)
  • pnpm turbo run test:vitest:e2e (all 16 e2e tasks pass, including consumer packages that import from @gtbuchanan/test-utils)

Break up the ~374-line fixture.ts whose responsibilities had drifted
(command execution, git env isolation, version pinning, tarball
matching, workspace discovery, and two fixture constructors) into
focused modules:

- lib/command.ts — CommandResult, runCommand, exec, createGitEnv
- lib/workspace.ts — PackageJson schema, workspace root/index memo,
  resolveWorkspaceDeps
- lib/tarball.ts — matchTarball, pinned, tarball memo, resolveTarballs
- isolated-fixture.ts — createIsolatedFixture + types
- project-fixture.ts — createProjectFixture, extendWithFixture + types
- fixture.ts — thin barrel re-exporting the public surface

Public API and behavior unchanged. Memo caches split cleanly: workspace
root/index live in workspace.ts, tarball cache in tarball.ts — no
cross-module state.

Closes #55
@gtbuchanan gtbuchanan merged commit 456dff4 into main Apr 22, 2026
7 of 8 checks passed
@gtbuchanan gtbuchanan deleted the fix/fixture-growth branch April 22, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test-utils: split fixture.ts into focused modules

1 participant