skovhus / jest-codemods

Codemods for migrating to Jest https://github.com/facebook/jest 👾
MIT License
877 stars 81 forks source link

`jasmine-globals`: support for `jest.setSystemTime()` #570

Closed puglyfe closed 3 months ago

puglyfe commented 3 months ago

When running the jasmine-globals transform against a codebase that uses jasmine.clock().mockDate(), there is a warning that this functionality is not supported in Jest (source).

This was likely true with Jest's legacy timers implementation, however, there is now jest.setSystemTime(), as well as the FakeTimersConfig.now option that can be used for this purpose.