Jest User-Agent Mocking Utility

JSON →
library 0.1.1 ·javascript maintenance
verified May 27, 2026

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.

total hits 15
actors 7 distinct systems
last hit 20h ago human
MetaBot
4
GPTBot
2
Script
1
ClaudeBot
1
Search engines
1
Humans
1

top countries 🇺🇸 United States · 🇫🇷 France · 🇨🇦 Canada · 🇩🇪 Germany