docs: add mock primitives to extension skill testing references#969
docs: add mock primitives to extension skill testing references#969
Conversation
Update all four skill testing references to document withMockedFetch, withMockedCommand, and local mock server patterns. Each skill doc now covers the appropriate mocking approach for its extension type: - Vault: withMockedCommand for CLI vaults (1password), local mock server + AWS_ENDPOINT_URL for AWS SDK vaults, withMockedFetch for REST API vaults - Datastore: local mock server for S3 verifier, mock client for lock testing, withMockedCommand for CLI-based datastores - Driver: withMockedFetch for HTTP drivers, withMockedCommand for subprocess drivers, local mock server for AWS SDK drivers - Report: withMockedFetch and withMockedCommand for reports that call external pricing APIs or CLI tools Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
There was a problem hiding this comment.
Code Review
This is a docs-only PR updating the four extension skill testing reference files to document the mock primitives from #968. All referenced APIs (withMockedFetch, withMockedCommand, assertVerifierConformance, assertLockConformance, etc.) are verified to exist and be properly exported from packages/testing/mod.ts.
Blocking Issues
None.
Suggestions
-
Inconsistent env cleanup in AWS mock server examples: The vault (
testing.md:119) and driver (testing.md:134) AWS SDK examples setAWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYbut only clean upAWS_ENDPOINT_URLin thefinallyblock. The datastore S3 example correctly cleans up all three. Consider making them consistent to avoid teaching a leaky pattern. -
Vault docs dropped
createVaultTestContextsection: The "In-Memory Test Double" section usingcreateVaultTestContextwas removed from the vault skill docs, while the datastore docs kept its equivalent (createDatastoreTestContext). The function still exists — consider keeping a brief mention for consumers who need a simple test double rather than full mocking.
Summary
references/testing.mdfiles to document the mock primitives from feat: add withMockedFetch and withMockedCommand to swamp-testing #968withMockedCommandfor CLI vaults, local mock server +AWS_ENDPOINT_URLfor AWS SDK vaults,withMockedFetchfor REST API vaultswithMockedCommandfor CLI-based datastoreswithMockedFetchfor HTTP drivers,withMockedCommandfor subprocess drivers, local mock server for AWS SDK driverswithMockedFetchandwithMockedCommandfor reports that call external APIs or CLI toolsTest Plan
🤖 Generated with Claude Code