Skip to content

Commit 4f1bafb

Browse files
Gpxgndelia
andauthored
Update docs/rules/no-wait-for-snapshot.test.md
Co-authored-by: Gonzalo D'Elia <[email protected]>
1 parent af9c8ee commit 4f1bafb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/rules/no-wait-for-snapshot.test.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Ensure that no calls to `toMatchSnapshot` are made from within a `waitFor` metho
77
The `waitFor()` method runs in a timer loop. So it'll retry every n amount of time.
88
If a snapshot is generated inside the wait condition, jest will generate one snapshot per loop.
99

10-
The problem then is the amount of loop ran until the condition is met will vary between different computers (or CI machines.) This leads to tests that will regenerate a lot of snapshots until the condition is match when devs run those tests locally updating the snapshots; e.g devs cannot run `jest -u` locally or it'll generate a lot of invalid snapshots who'll fail during CI.
10+
The problem then is the amount of loop ran until the condition is met will vary between different computers (or CI machines). This leads to tests that will regenerate a lot of snapshots until the condition is matched when devs run those tests locally updating the snapshots; e.g devs cannot run `jest -u` locally or it'll generate a lot of invalid snapshots who'll fail during CI.
1111

1212
Note that this lint rule prevents from generating a snapshot from within any of the [async utility methods](https://testing-library.com/docs/dom-testing-library/api-async).
1313

0 commit comments

Comments
 (0)