logoalt Hacker News

Alupistoday at 2:50 PM2 repliesview on HN

Just skimmed the PR, I'm sure the author knows more than I - but why hard code a date at all? Why not do something like `today + 1 year`?


Replies

johanvtstoday at 3:02 PM

That introduces dependency of a clock which might be undesirable, just had a similar problem where i also went for hardcoding for that reason.

show 2 replies
whynotmaybetoday at 3:02 PM

Because it should be `today + 1 year + randomInt(1,42) days`.

Always include some randomness in test values.

show 5 replies