Skip to content

docs: add "Mock Your Own Tests" guide (keploy mock record|replay) - #899

Merged
slayerjain merged 2 commits into
mainfrom
docs/mock-your-tests
Aug 22, 2026
Merged

docs: add "Mock Your Own Tests" guide (keploy mock record|replay)#899
slayerjain merged 2 commits into
mainfrom
docs/mock-your-tests

Conversation

@slayerjain

@slayerjain slayerjain commented Aug 22, 2026

Copy link
Copy Markdown
Member

What

Documents the new keploy mock record|replay feature (keploy/keploy#4469) — using Keploy as a language-agnostic mocking framework for your own test suite. Two pages under running-keploy:

  1. Mock Quickstart (mock-quickstart.md) — a hands-on "Get Started in 2 Minutes" walkthrough: a sample pytest suite + dependency, keploy mock record, the generated mocks.yaml, offline keploy mock replay, --on-miss record refresh, and exit-code propagation. Every step shows the real captured terminal output.
  2. Mock Your Own Tests (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-keploy sidebar after custom-mocks. Quickstart outputs were captured by actually running the feature.

Related

keploy/keploy#4469 (feature), keploy/enterprise#2424 (registry-backed store).

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
slayerjain force-pushed the docs/mock-your-tests branch from cfc0919 to 6cf9831 Compare August 22, 2026 04:26
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>
@slayerjain
slayerjain merged commit 490ff11 into main Aug 22, 2026
7 checks passed
@slayerjain
slayerjain deleted the docs/mock-your-tests branch August 22, 2026 12:39
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