{"id":"eyycheev/jest-fake-timers","name":"jest-fake-timers","scope":"eyycheev","platform":"roblox","description":"Mirrored from the Wally registry.","version":"3.14.0-rbx.2","latest":"3.14.0-rbx.2","versions":["3.14.0-rbx.0","3.14.0-rbx.1","3.14.0-rbx.2"],"license":"MIT","licenseRating":"safe","licenseCaveats":["The package archive does not include its license text; the license is declared in its manifest metadata."],"licenseVerified":false,"dependencies":{"eyycheev/jest-get-type":{"version":"^3.14.0-rbx.2","alias":"JestGetType"},"eyycheev/jest-mock":{"version":"^3.14.0-rbx.2","alias":"JestMock"},"jsdotlua/luau-polyfill":{"version":"^1.2.7","alias":"LuauPolyfill"}},"integrity":"0356bb67fdbd3876318923a69906df7b17c5a7b980898a8c4bbcd706b30dff54","likes":0,"downloads":0,"install":"forest install eyycheev/jest-fake-timers","url":"https://forest.dev/p/roblox/eyycheev/jest-fake-timers","files":"https://api.forest.dev/ai/package/roblox/eyycheev/jest-fake-timers/files","readme":"# jest-fake-timers\n\nUpstream: https://github.com/facebook/jest/tree/v27.4.7/packages/jest-fake-timers\n\nThis package contains the fake timers implementation for Jest. It can be activated by calling `jest.useFakeTimers()`. You can find its documentation in the [Jest documentation](https://roblox.github.io/jest-roblox-internal).\n\nThe following timers are mocked:\n* `delay`\n* `tick`\n* `time`\n* `os`\n    * `os.time`\n\t* `os.clock`\n* `task.delay`\n    * `task.delay`\n\t* `task.cancel`\n\t* `task.wait`\n* `DateTime`\n\n---\n\n### :pencil2: Notes\n:exclamation: The fake timer API in Jest Roblox is aligned with the \"modern\" fake timer implementation in Jest. However, the actual implementation of fake timers in Jest Roblox under the hood massively deviates from upstream so that it works natively with the Roblox ecosystem.\n\nSimilar to how Jest fake timers work by mocking the native timer functions (i.e. `setTimeout`, `setInterval`, `clearTimeout`, `clearInterval`) and `Date`, Jest Roblox fake timers work by mocking the native timer functions in Roblox (i.e. `delay`, `tick`), the Roblox `DateTime` and the Lua native timer methods `os.time` and `os.clock`.\nAdditionally, Jest Roblox fake timers support a configurable engine frame time. By default, the engine frame time is 0 (i.e. continuous time), but if set, Jest Roblox fake timers will be processed by multiples of frame time. If engine frame time is set, then timers will be processed in the first frame after they are triggered.\n","readmeTruncated":false}