Skip to content

z.date() does not work with vi.setSystemTime() #2764

Discussion options

You must be logged in to vote

This seems to have nothing to do with Zod.

https://vitest.dev/api/vi.html#vi-setsystemtime

you need to use vi.useFakeTimers()

If you found my answer satisfactory, please consider supporting me. Even a small amount is greatly appreciated. Thanks friend! 🙏
https://github.com/sponsors/JacobWeisenburger

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@agos
Comment options

Answer selected by JacobWeisenburger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #2592 on September 22, 2023 15:02.