Sometimes we need to implement functions that need to be executed by cronjobs. It’s a good practice to unit test those functions, so let’s learn how to simulate a given time in a unit test!

What we’re going to do

Verify if function is executed at 15:20:00 (UTC) of 30th…

Todo mundo comete erros! Uma variável não declarada aqui, um erro de digitação ali e quando percebemos, fizemos commit de um código com erros de sintaxe. Eu já fiz isso, você já fez isso e eu posso apostar que todos desenvolvedores já fizeram isso alguma vez. …

Everyone makes mistakes! An undeclared variable here, a typo there and when we realize, we’ve committed code with silly syntax errors. I’ve done it, you’ve done it and I’m pretty sure that every coder out there has done it. Don’t feel bad, it’s human nature.

And then someone invented the…

Amir Elemam

Senior Backend Software Engineer (Node.js)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store