You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-6Lines changed: 11 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -158,13 +158,18 @@ Coverage thresholds: 85% branches/functions, 90% lines/statements. Tests live in
158
158
159
159
Visual regression testing to catch unintended UI changes, especially useful when upgrading dependencies.
160
160
161
-
```bash
162
-
yarn build # Must build first
163
-
yarn test:screenshots # Run visual regression tests
164
-
yarn test:show-report # View test failure report
165
-
```
161
+
The best strategy is to run the tests on a clean branch **before** making changes to gather baseline screenshots, then run them again after your changes to detect regressions.
162
+
163
+
#### Running screenshot tests locally
164
+
165
+
1. Run `yarn build`
166
+
2. Run `yarn test:screenshots` — all tests will fail on the first pass since no baseline screenshots exist yet
167
+
3. Run `yarn test:screenshots` again — all tests should now pass (baselines have been captured)
168
+
4. Make your changes (dependency upgrades, etc.)
169
+
5. Run `yarn test:screenshots` to check for visual regressions
170
+
6. Run `yarn test:show-report` to view failures
166
171
167
-
**Workflow:**Run tests on a clean branch to capture baseline screenshots. Make your changes, then run tests again to detect regressions.
172
+
> **Tip:**If tests keep timing out on a clean branch, try running `yarn start` first. Cancel once the dev build completes, then re-run the tests.
0 commit comments