Skip to content

Tutorial Coverage Expansion

hypersdk edited this page Aug 7, 2026 · 1 revision

Tutorial: Coverage Expansion

Discover untested routes/pages from the product repo (and optional live crawl), then generate gap-filling tests.

Deep: Tutorial 05. Prerequisites: GitHub Integration.

1. Discover only

zyvor-qa discover --source github

Scans (via COVERAGE_DISCOVERY_PATHS):

Location Candidates
src/pages/, src/routes/, app/ Routes (vm.tsx/vm)
docs/, specs, README, CHANGELOG Page/doc headings
sidebars*, Docusaurus config Doc IDs
openapi*.json/yaml API paths

Covered when path/slug appears in existing specs (goto, toHaveURL, or title).

2. Fill the gaps

zyvor-qa run --source github --expand-coverage
zyvor-qa generate --source github --expand-coverage   # generate only

Writes tests/generated/coverage-route-….spec.ts. Capped by COVERAGE_MAX_NEW_TESTS (default 10) — re-run to continue the backlog.

Always-on for GitHub/webhook runs:

ENABLE_COVERAGE_EXPANSION=true

Note: explicit --spec disables expansion unless you also pass --expand-coverage.

3. PR-scoped discovery

On PR/push webhooks (or discover --pr-number N), inventory is limited to changed files. PR comments include a Coverage section (inventory / gaps / new tests).

4. Live-site crawl

ENABLE_LIVE_CRAWL=true
CRAWL_MAX_PAGES=50
CRAWL_MAX_DEPTH=2

BFS same-origin links from / merge into inventory. Standalone: npm run crawl.

Next

GitHub Integration · External CI/CD · Architecture

Clone this wiki locally