docs: add "Mock Your Own Tests" guide (keploy mock record|replay) - #899
Merged
Conversation
Document `keploy mock record|replay` — using Keploy as a language-agnostic mocking framework for a user's own test suite. - mock-your-tests.md: the reference. Covers --on-miss fail|passthrough|record, --strict, the per-test scope API (KEPLOY_MOCK_AGENT + /agent/scope/begin|end) with pytest/go/jest examples, platform support, and a CI refresh recipe. - mock-quickstart.md: a hands-on "Get Started in 2 Minutes" walkthrough with a sample billing app whose tests call an external users API. Devs copy three files and follow record -> offline replay -> --on-miss record refresh, each step showing the actual captured keploy output. Both added to the version-4.0.0 running-keploy sidebar after custom-mocks. Files pass the repo's prettier check. Signed-off-by: slayerjain <shubhamkjain@outlook.com>
slayerjain
force-pushed
the
docs/mock-your-tests
branch
from
August 22, 2026 04:26
cfc0919 to
6cf9831
Compare
The scope API now takes an optional `pid`; passing the worker's PID scopes the served mock pool per worker so Playwright/jest workers, pytest-xdist and `go test` -parallel each get only their own test's mocks. Replaces the "sequential only" caveat with the parallel guidance and adds the pid to the pytest / go / playwright snippets. Omitting pid keeps the sequential fallback. Signed-off-by: slayerjain <shubhamkjain@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Documents the new
keploy mock record|replayfeature (keploy/keploy#4469) — using Keploy as a language-agnostic mocking framework for your own test suite. Two pages underrunning-keploy:mock-quickstart.md) — a hands-on "Get Started in 2 Minutes" walkthrough: a sample pytest suite + dependency,keploy mock record, the generatedmocks.yaml, offlinekeploy mock replay,--on-miss recordrefresh, and exit-code propagation. Every step shows the real captured terminal output.mock-your-tests.md) — the reference:--on-miss fail|passthrough|record,--strict, the per-test scope API with pytest/go/jest examples, platform support, and a CI refresh recipe.Both added to the version-4.0.0
running-keploysidebar aftercustom-mocks. Quickstart outputs were captured by actually running the feature.Related
keploy/keploy#4469 (feature), keploy/enterprise#2424 (registry-backed store).