logoalt Hacker News

devintoday at 3:09 PM2 repliesview on HN

Are you joking? This is the kind of thing that leads to flaky tests. I was always counseled against the use of randomness in my tests, unless we're talking generative testing like quickcheck.


Replies

dathinabtoday at 4:25 PM

or, maybe, there is something hugely wrong with your code, review pipeline or tests if adding randomness to unit test values makes your tests flaky and this is a good way to find it

show 1 reply
whynotmaybetoday at 3:13 PM

`today` is random.

show 2 replies