mock-property provides a simple and clean way to mock object properties in JavaScript, primarily for testing purposes. It allows you to temporarily override a property on an object with a mock value, and easily restore the original value when the test is complete. This is useful for isolating units of code and controlling external dependencies during testing, offering better predictability and control over test outcomes. The package offers a streamlined API for easy integration into your existing testing framework.
The npm package mock-property saw infrequent releases. One version was published in April 2022 (1.0.0), followed by three versions in October 2023 (1.0.1, 1.0.2, 1.0.3). Another version was released in August 2024 (1.1.0). No releases occurred in other months between April 2022 and August 2025.
Mock-property downloads show strong growth, beginning with around 447k downloads in March 2024 and peaking at 1.79 million in July 2025. A notable surge occurred in mid-2025. September 2025 data is incomplete but already shows over 427k downloads.