-
Notifications
You must be signed in to change notification settings - Fork 0
feat(testing): add test fixture utilities #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: p3-16/mcp/server-impl
Are you sure you want to change the base?
Conversation
80648b0 to
cb54780
Compare
563d1cc to
d5b1567
Compare
00fb00e to
d264bd0
Compare
a57045a to
4d06f54
Compare
Greptile Summary
|
| Filename | Overview |
|---|---|
| packages/testing/src/fixtures.ts | New file providing core testing utilities; includes temp directory management, environment isolation, and fixture loading with automatic cleanup |
| packages/testing/package.json | New package configuration with comprehensive exports structure for testing harnesses; requires review of export paths alignment with actual implementation |
Confidence score: 4/5
- This PR is safe to merge with minor concerns about export path alignment
- Score reflects solid implementation patterns but potential mismatch between declared exports and current file structure - package.json declares exports for cli-harness and mcp-harness modules that don't exist yet
- Pay close attention to
packages/testing/package.jsonexports configuration to ensure all declared paths will be implemented
Sequence Diagram
sequenceDiagram
participant User
participant FixtureFactory as "Fixture Factory"
participant TempDir as "Temp Directory"
participant EnvManager as "Environment Manager"
participant FileSystem as "File System"
User->>FixtureFactory: "createFixture(defaults)"
FixtureFactory->>FixtureFactory: "deepClone(defaults)"
FixtureFactory-->>User: "factory function"
User->>FixtureFactory: "factory(overrides)"
FixtureFactory->>FixtureFactory: "deepMerge(cloned, overrides)"
FixtureFactory-->>User: "merged fixture"
User->>TempDir: "withTempDir(fn)"
TempDir->>FileSystem: "mkdir(tempPath)"
FileSystem-->>TempDir: "directory created"
TempDir->>User: "fn(tempPath)"
User-->>TempDir: "result"
TempDir->>FileSystem: "rm(tempPath, recursive)"
TempDir-->>User: "result"
User->>EnvManager: "withEnv(vars, fn)"
EnvManager->>EnvManager: "store original env"
EnvManager->>EnvManager: "set new env vars"
EnvManager->>User: "fn()"
User-->>EnvManager: "result"
EnvManager->>EnvManager: "restore original env"
EnvManager-->>User: "result"
User->>FileSystem: "loadFixture(name)"
FileSystem->>FileSystem: "readFileSync(filePath)"
FileSystem->>FileSystem: "parse if JSON"
FileSystem-->>User: "fixture data"
4d06f54 to
a33da83
Compare
d264bd0 to
d24df4b
Compare
|
Reviewed Greptile note: package exports now only include the fixtures entrypoint and the root index re-exports fixtures, so exports align with the current file set in this PR. |
|
Fixed @outfitter/testing exports so the root entrypoint exists at this layer, and added fixtures tests to satisfy package test runs. Restacked and submitted the update with gt. |
a33da83 to
cddc577
Compare
d24df4b to
bd9332b
Compare
|
Restacked after downstack update (formatRelative test stabilization); no additional changes in this PR. |
cddc577 to
ac76953
Compare
bd9332b to
65d3dd3
Compare
|
Confirmed @outfitter/testing now ships src/index.ts (root export) and only exports ./fixtures; missing harness subpaths are no longer advertised. Resubmitted after restack. |

Add fixture helpers for test environments:
Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com
Contributes to #47