This repository uses a monorepo layout (apps/*, packages/*) with tests and linting enforced before merge.
- Create a focused branch for your issue.
- Keep changes scoped and reviewable.
- Add or update tests with behavior changes.
- Run checks locally before opening a PR:
npm run test
npm run lint
npm run build- Link the PR to the relevant issue.
Visual regression baselines for deployment preview templates are stored in:
apps/backend/tests/visual/baselines/deployment-preview/dex.baseline.jsonapps/backend/tests/visual/baselines/deployment-preview/defi.baseline.jsonapps/backend/tests/visual/baselines/deployment-preview/payment.baseline.jsonapps/backend/tests/visual/baselines/deployment-preview/asset.baseline.json
Run this in default mode to validate that generated screenshots remain within the allowed diff threshold:
npm run --workspace @craft/backend test -- tests/visual/preview.visual.test.tsCI runs the same compare path in .github/workflows/visual-regression.yml. Any diff over threshold fails the job.
When intentional visual changes are made to deployment preview templates, regenerate and commit updated baselines:
VISUAL_BASELINE_MODE=store npm run --workspace @craft/backend test -- tests/visual/preview.visual.test.tsOn Windows PowerShell:
$env:VISUAL_BASELINE_MODE='store'
npm run --workspace @craft/backend test -- tests/visual/preview.visual.test.ts
Remove-Item Env:VISUAL_BASELINE_MODE- Include before/after screenshots for each affected template category (
dex,defi,payment,asset). - Keep baseline-only updates in small, reviewable commits.
- Ensure baseline-missing failures are not bypassed; tests should fail with a clear missing-baseline message.