If I have an operation that is dependent on &quot;now&quot;, I typically generate that time at the beginning of the operation and pass it as a parameter to everything else. So now all the important bits I can test with whatever timestamp I want. And if I really want to, I could test that the operation initialization generates the correct timestamp. But that&#x27;s pretty close to testing whether &quot;new Date()&quot; works, which if it doesn&#x27;t there&#x27;s not a whole lot I can do about it anyway.