Skip to content

docs: add mock primitives to extension skill testing references#969

Merged
stack72 merged 1 commit intomainfrom
add-mock-primitives
Mar 30, 2026
Merged

docs: add mock primitives to extension skill testing references#969
stack72 merged 1 commit intomainfrom
add-mock-primitives

Conversation

@stack72
Copy link
Copy Markdown
Contributor

@stack72 stack72 commented Mar 30, 2026

Summary

  • Update all four extension skill references/testing.md files to document the mock primitives from feat: add withMockedFetch and withMockedCommand to swamp-testing #968
  • Each skill doc now covers the appropriate mocking approach:
    • Vault: withMockedCommand for CLI vaults, local mock server + AWS_ENDPOINT_URL for AWS SDK vaults, withMockedFetch for REST API vaults
    • Datastore: local mock server for verifier testing, mock client pattern 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 APIs or CLI tools

Test Plan

  • Docs-only change, no code affected

🤖 Generated with Claude Code

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]>
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. Inconsistent env cleanup in AWS mock server examples: The vault (testing.md:119) and driver (testing.md:134) AWS SDK examples set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY but only clean up AWS_ENDPOINT_URL in the finally block. The datastore S3 example correctly cleans up all three. Consider making them consistent to avoid teaching a leaky pattern.

  2. Vault docs dropped createVaultTestContext section: The "In-Memory Test Double" section using createVaultTestContext was 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.

@stack72 stack72 merged commit 80704bd into main Mar 30, 2026
10 checks passed
@stack72 stack72 deleted the add-mock-primitives branch March 30, 2026 23: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.

1 participant