Unit Testing with Current Timestamps

I’m trying to set unit tests up on my pipeline for transforms that generate a current timestamp using the Current Timestamp built-in expression.

Manually adding expected outputs in this case seems somewhat impossible because of the current timestamps being so accurate.

Am I missing something?

Thanks!

Are you able to separate out the step where you generate current timestamps into another node? Unfortunately, there’s no current way to override the current timestamp just for unit tests.

For example, if the transform generating current timestamps is in the middle of the transforms you want to unit test, can you split up your unit tests into two? One for before and one for after?

Alternatively, if the date is irrelevant to the logic you’re trying to unit test, you can create a transform (just for unit testing) which drops the current date.