{"library":"jest-date-mock","type":"library","category":null,"description":"jest-date-mock is a lightweight utility library for mocking the global `Date` object within Jest unit tests, simplifying the testing of time-sensitive logic. Currently at version 1.0.10, the library provides a minimalistic API to control the current time, allowing users to advance time by milliseconds (`advanceBy`), set the time to a specific timestamp (`advanceTo`), and clear the mock (`clear`). It also provides `Date.current()` to access the true system time while mocked. Releases are frequent for minor fixes and improvements, with version 1.0.9 adding support for `performance.now()` and version 1.0.8 ensuring `Date.name` remains 'Date' for compatibility with other libraries. Its key differentiator is its focused scope on `Date` and `performance.now()` mocking without interfering with other timers, contrasting with Jest's built-in `useFakeTimers` which handles a broader set of time-related APIs.","language":"javascript","status":"active","version":"1.0.10","tags":["javascript","mock","jest","jest-date","Date","datetime","timestamp","typescript"],"last_verified":"Wed May 27","install":[{"cmd":"npm install jest-date-mock","imports":["import { advanceTo } from 'jest-date-mock';","import { advanceBy } from 'jest-date-mock';","import 'jest-date-mock';"]},{"cmd":"yarn add jest-date-mock","imports":[]},{"cmd":"pnpm add jest-date-mock","imports":[]}],"homepage":null,"github":"https://github.com/hustcc/jest-date-mock","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/jest-date-mock","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/jest-date-mock/compatibility"}}