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
This sounds like an interesting rule, but I don't see the problem 100% clear. Could you elaborate more around the issues this can cause please? Thanks.
The problem is that wait() runs in a timer loop. So it'll retry every n amount of time.
If there's a snapshot inside the wait condition, jest will generate one snapshot per loop.
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.
This would be fine if snapshots were generated manually; but auto-update causes conflicts.
I see. Yeah, didn't think about the auto update. This can definitely be a nice rule, something like no-wait-snapshot. Are you interested into give it a try?
Activity
Belco90 commentedon Aug 17, 2020
Hey Simon, sorry for the late response!
This sounds like an interesting rule, but I don't see the problem 100% clear. Could you elaborate more around the issues this can cause please? Thanks.
SBoudrias commentedon Aug 18, 2020
Yes of course!
The problem is that
wait()runs in a timer loop. So it'll retry every n amount of time.If there's a snapshot inside the wait condition, jest will generate one snapshot per loop.
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 -ulocally or it'll generate a lot of invalid snapshots who'll fail during CI.This would be fine if snapshots were generated manually; but auto-update causes conflicts.
Belco90 commentedon Aug 18, 2020
I see. Yeah, didn't think about the auto update. This can definitely be a nice rule, something like
no-wait-snapshot. Are you interested into give it a try?feat: 🎸 new no-wait-snapshot rule
feat: 🎸 new no-wait-snapshot rule
feat: 🎸 new no-wait-for-snapshot rule
feat: 🎸 new no-wait-for-snapshot rule
feat: 🎸 new no-wait-for-snapshot rule
feat: 🎸 new no-wait-for-snapshot rule
feat: new no-wait-for-snapshot rule (#223)
Belco90 commentedon Aug 31, 2020
🎉 This issue has been resolved in version 3.8.0 🎉
The release is available on:
Your semantic-release bot 📦🚀
chore: merge master into v4 (#233)
github-actions commentedon Mar 28, 2021
🎉 This issue has been resolved in version 4.0.0-beta.1 🎉
The release is available on:
Your semantic-release bot 📦🚀
v4 (#322)
github-actions commentedon Apr 11, 2021
🎉 This issue has been resolved in version 4.0.0 🎉
The release is available on:
Your semantic-release bot 📦🚀