Vitest Chrome API Mock
JSON →vitest-chrome is a testing utility designed to provide a comprehensive mock of the Chrome Extension API, enabling developers to test their Chrome extension logic within a Vitest environment without requiring a real browser. As of version 0.1.0, it offers a complete set of mocked functions and events, all type-checked and based on the official `@types/chrome` definitions. This allows for robust and reliable testing of Chrome API interactions, including event listeners, synchronous API calls, and asynchronous functions relying on callbacks or `chrome.runtime.lastError`. The library is primarily used as a development dependency and integrates directly with Vitest's global setup to expose the mocked `chrome` object, simplifying the testing workflow for extension development.
Traffic · last 30 days ↓25% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇩🇪 Germany