Preparing for system design interviews?  Try bugzed.com →

babel-plugin-mockable-imports

JSON →
library 2.0.1 ·javascript
verified Jun 17, 2026

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.

total hits 18
actors 4 distinct systems
last hit 16d ago ByteDance
ByteDance
5
GPTBot
4
Script
1
Humans
4

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