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: docs/rules/no-wait-for-snapshot.test.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ Ensure that no calls to `toMatchSnapshot` are made from within a `waitFor` metho
7
7
The `waitFor()` method runs in a timer loop. So it'll retry every n amount of time.
8
8
If a snapshot is generated inside the wait condition, jest will generate one snapshot per loop.
9
9
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.
11
11
12
12
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).
0 commit comments