jest-canvas-mock provides a simple, lightweight mock for the HTML canvas element and its 2D rendering context within a Jest testing environment. This eliminates the need to run tests in a full browser, improving speed and efficiency. It enables testing code that relies on canvas functionality, like chart rendering or image manipulation, without actual rendering. Offers basic canvas API implementations to verify function calls and attribute settings, making canvas-related unit tests reliable and maintainable.
Jest-canvas-mock's release frequency is sporadic. Initial bursts of releases occurred in late 2017 and throughout 2018. Releases became less frequent after 2019. From 2021 onwards, releases are very sparse, typically one per year or less. There have been no releases in the first seven months of 2025.
Jest-canvas-mock npm package downloads show a strong upward trend from February 2024 (3.7M) to July 2025 (10.8M). There is consistent growth month-over-month. August 2025 shows a partial month's data of 4.5M, likely to fall below July's total when complete but still indicative of high usage.