Skip to content
v0.38.1

TDD mode

Full CLI reference for v0.38.1, published . Cloud features may behave differently today.

TDD mode compares screenshots on your machine. Use tests that capture through a Vizzly client. Local baselines, screenshots, and reports live under .vizzly/. Add that directory to .gitignore.

Run tests once

Terminal window
npx vizzly tdd run "npm test" --no-open

This runs the tests and leaves the browser closed. Omit --no-open to open the report. When differences should fail the run, add --fail-on-diff.

After reviewing a change, update the local baseline with a deliberate run:

Terminal window
npx vizzly tdd run "npm test" --no-open --set-baseline

Comparison data is saved in .vizzly/report-data.json. When the command prints a static report path, save that report directory as a CI artifact. If a run ends without producing an HTML report, use tdd start --open and rerun the tests against its live dashboard.

Keep the dashboard open

Terminal window
npx vizzly tdd start --open
npx vizzly tdd status
npx vizzly tdd list
npx vizzly tdd stop

Run your tests in another terminal while the server is running. start prints the dashboard URL. The usual port is 47392; use the URL that start prints when another port is selected. Pass --port on start to choose a port. If a running server cannot be reached, check tdd list before starting another one.

Use tdd status --port 47393 or tdd stop --port 47393 to target a specific registered server.

Use an approved cloud baseline

Terminal window
npx vizzly tdd run "npm test" --baseline-build build-id --no-open

Use --baseline-comparison for a single comparison. These options need cloud authentication.

Cloud baseline downloads also bring down dynamic-content metadata for the local comparisons.

Read local results

Use the screenshot commands to inspect captures from the latest local run. They work after the server stops and need no cloud login.

Terminal window
npx vizzly tdd screenshots list --page 1 --page-size 20 --json
npx vizzly tdd screenshots list --status failed --json
npx vizzly tdd screenshots list --status new --json
npx vizzly tdd screenshots show <comparison-id> --image all --json
npx vizzly tdd screenshots latest "Dashboard"

list shows IDs, browser and viewport variants, and current image paths. Use IDs when names match several variants. If hasNext is true, use the next page with the same page size and filters.

show gives you comparison details and the current image path. Add --image all for baseline and diff paths too. Check each image's exists flag, then open the files. latest [name] prints the newest current image path.

Local failed means the image changed; error means the comparison couldn't run. The report doesn't record the Git commit. If it might be old, rerun your tests.

Once you've reviewed a change, accept one local baseline with:

Terminal window
npx vizzly tdd screenshots accept <comparison-id> --json

This updates one local baseline and the saved report. Cloud review decisions are handled separately.

See scripting for cloud API requests and JSON output.