Jest.usefaketimers使用MUI V5台式机时有时

发布于 2025-02-08 07:25:44 字数 198 浏览 2 评论 0原文

在尝试使用MUI-X V5桌面的测试进行测试时,我想使用jest usefaketimers来设置系统时间,这将使我能够使用new Date()和下一步测试选择日期,并使用new date()几个月(因为我过去的选择已禁用)。设置jest.usefaketimers()我的测试超时。有解决方案吗?

When trying to run tests with MUI-X v5 DesktopDatePicker, I would like to use Jest useFakeTimers to set the system time that will allow me to test selecting dates with running into issues using new Date() and next months (as I have past selections disabled). When setting jest.useFakeTimers() my test timeout. Is there a solution for this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文