Pages tagged "testing"
Posts
Golang Testing time.Now
Testing time objects can be a pain. Some languages offer some helpful libraries that can help like VCR in Ruby. Other tools to help are mocking libraries to where you can mock and stub out the time calls to what you want. In golang there is another way to help and that is using dependency injection to help make testing easier.
Posts
Momentjs Date Mutation
If you’ve ever had to work with a lot of date logic in javascript you’ve likely used or at least seen Momentjs. It can be convenient for moving dates to other timezones or date math. I ran into another today I learned moment trying to write some tests in Jest while using moment to handle dates in test setup and fixtures.