4 ms·
I was just referring to how pipes make these kinds of chained function calls more readable. But on your point, I think using Date.now() is perfectly ok.
by POiNTx 11mo ago
I was just referring to how pipes make these kinds of chained function calls more readable. But on your point, I think using Date.now() is perfectly ok.
- vlovich123 11mo agoWhat happens during a daylight savings adjustment?
- POiNTx 11mo agoYou use UTC which doesn't adjust daylight savings.
- ruszki 11mo ago> I think using Date.now() is perfectly ok. This is why we have tests which we need to update every 3 months, because somebody said this. This is of course, after a ton of research went into finding out why the heck our tests broke suddenly.
- Izkata 11mo agoI would call those badly-written tests. The current date/time exists outside the system and ought to be acceptable for mocks, and in python we have things like freezegun that make it easy to control without the usual pitfalls of mocks.
- ruszki 11mo agoWhat are those mock pitfalls, which are avoided by freezegun which is a mock according even to them? IoC and Clocks solve the same problem. So what are the pitfalls of using those instead of this other mock?
- Izkata 11mo agoApplying it to the wrong module, a very common mistake in python due to how imports work.