veganism.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Veganism Social is a welcoming space on the internet for vegans to connect and engage with the broader decentralized social media community.

Administered by:

Server stats:

283
active users

#flakyTests

0 posts0 participants0 posts today
Michal Bryxí 🌱<p>I bumped into this again on an asymc (frontend) test suite and I have bad news for everyone:</p><p>If you don&#39;t run your tests in (pseudo)random order, you have no clue if your test suite is stable or not. No, none, nil, even if you&#39;ve never seen it fail.</p><p>Do run your tests in random sequence. Always.</p><p><a href="https://veganism.social/tags/Testing" class="mention hashtag" rel="tag">#<span>Testing</span></a> <a href="https://veganism.social/tags/Frontend" class="mention hashtag" rel="tag">#<span>Frontend</span></a> <a href="https://veganism.social/tags/JS" class="mention hashtag" rel="tag">#<span>JS</span></a> <a href="https://veganism.social/tags/FlakyTests" class="mention hashtag" rel="tag">#<span>FlakyTests</span></a></p>
Michal Bryxí 🌱<p>If there is more than one call to `faker.seed` in your entire test suite then you are *very* likely to hit many problems once the code grows big.</p><p>One of the easiest way to show almost guaranteed free lying rake is the concept of IDs that in most cases *need* to be unique for different instances of the same model. For that faker has cool function `uuid()` that promise to give you exactly that ... unless you use `seed`:</p><p>```<br />faker.seed(1);<br />const uuid1 = faker.datatype.uuid();</p><p>...</p><p>faker.seed(1);<br />const uuid2 = faker.datatype.uuid();</p><p>console.log(uuid1 === uuid2); // true<br />```</p><p>There are many others and even if you think this does not apply to your case the unnecessary risk is IMO way too high to instil this in your code.</p><p><a href="https://veganism.social/tags/faker" class="mention hashtag" rel="tag">#<span>faker</span></a> <a href="https://veganism.social/tags/testing" class="mention hashtag" rel="tag">#<span>testing</span></a> <a href="https://veganism.social/tags/seed" class="mention hashtag" rel="tag">#<span>seed</span></a> <a href="https://veganism.social/tags/flakyTests" class="mention hashtag" rel="tag">#<span>flakyTests</span></a></p>