babel-plugin-mockable-imports
JSON →A Babel plugin that transforms JavaScript/TypeScript modules to enable mocking of ES imports in tests. Current stable version is 2.0.1. It works with any test runner, bundler, and environment (Node or browser). Unlike tools like proxyquire or rewire, it operates at the Babel AST level, making it compatible with modern ES module syntax. The plugin detects incorrect usage (e.g., mocking non-existent imports) and is designed to minimize runtime overhead. It supports both JavaScript and TypeScript, and can be selectively enabled via Babel's env configuration.
Traffic · last 30 days ↑14% vs prev 7d
total hits 28
actors 8 distinct systems
last hit 2d ago human
top countries 🇺🇸 United States · 🇩🇪 Germany · 🇸🇬 Singapore · 🇨🇦 Canada · 🇬🇧 United Kingdom
Resources
API endpoints
compatibility /v1/registry/babel-plugin-mockable-imports/compatibility