When to use it
- You review code by reading diffs and want a runtime signal next to them.
- You want failures attributed to the change that introduced them, while the
author still has context, instead of discovering them days later on
main. - You want new code to arrive with coverage instead of relying on someone remembering to add a test.
Where it fits in review
- Run the tests as a required check on the pull request branch so a failing run blocks the merge, the same way unit tests or linting do.
- Run against the branch’s preview deployment so you exercise the code in the PR, not production. For protected previews, see Vercel preview auth.
- A passing run is evidence the change works; a failing run is a reproduction with a trace you can open, not just a comment thread.
Cover what the PR changed
A static test suite only catches regressions in flows you already test. Use the explore agent to read the diff, find the user journeys it changed, and draft tests for the ones you do not cover yet.--build to have it open the drafted tests as a pull request you
review before they merge.
Get started
Add Momentic to CI
Run the tests in your CI pipeline on pull requests. Store your
MOMENTIC_API_KEY as a CI secret. See GitHub
Actions, GitLab
CI, or custom
setups.Point tests at the PR's preview
Set the base URL to the branch’s preview deployment so each run tests the
proposed change, not production.
Cover new journeys
Run
momentic ai explore against the diff to find changed
journeys, and add tests for the ones not yet covered.Keep PR feedback fast and trustworthy
- Shard large test suites across CI jobs with
--shard-countand--shard-indexso a PR is not blocked waiting on a serial run. - Decide a flake policy up front. Quarantined tests run but do not fail the PR
by default; pass
--skip-quarantinedto skip them, or--ignore-quarantineto make every status count. See quarantine. - The base URL set on a test takes precedence over
--url-override; leave it unset on tests you want to retarget per environment.
Related
Explore agent
Find the journeys a diff changed and author tests for them.
GitHub Actions
Run Momentic on pull requests, with sharding and secrets.
Regression testing
Protect existing flows across every change.
Vercel preview auth
Test against protected preview deployments.