Jest User-Agent Mocking Utility
JSON →jest-useragent-mock is a lightweight utility designed to facilitate the mocking of `navigator.userAgent` within Jest unit tests. It provides simple functions, `mockUserAgent` and `clear`, to set and reset the browser's user-agent string, making it easier to test browser-specific logic or user-agent dependent features. The current stable version is 0.1.1. Given its specific scope and low version, it operates on an infrequent release cadence, appearing to be in a maintenance state with no recent updates since its initial release. Its key differentiator is its singular focus on `navigator.userAgent` mocking, directly integrating with Jest's setup files for global application across test suites, distinguishing it from broader mocking libraries by offering a specialized, minimalist solution.
Traffic · last 30 days ↑25% vs prev 7d
top countries 🇺🇸 United States · 🇫🇷 France · 🇨🇦 Canada · 🇩🇪 Germany