DEV Community

Discussion on: Deterministic unit tests for current date-dependent code in Swift.

Collapse
 
mariusdereus profile image
m.dereus

Nice solution!
As an addition: in the application code the use of Date(timeIntervalSinceNow:) should be avoided as well, because that returns also a date based on the system time.

Collapse
 
ivanmisuno profile image
Ivan Misuno

Yes, indeed! Going to update the pre-commit hook accordingly.