Egg.js Mock Testing Utility

JSON →
library 5.15.2 ·javascript
verified May 27, 2026

egg-mock is a dedicated testing utility for Egg.js applications, plugins, and custom Egg frameworks. It provides robust mocking capabilities, extending the functionalities of `node_modules/mm`. The library allows developers to simulate various aspects of an Egg.js application's environment, including application instances (`mm.app`), multi-process clusters (`mm.cluster`), environment variables (`mm.env`), and user home directories (`mm.home`). It also offers fine-grained control over console logging levels. Currently in stable version `6.0.7`, egg-mock maintains an active release cadence, with frequent updates addressing bugs and improving compatibility. Major version `6.0.0` was released in December 2024. Key differentiators include its tight integration with the Egg.js ecosystem, enabling comprehensive end-to-end testing scenarios, and its ability to handle both single and multi-process application mocking. It ships with TypeScript type definitions for an enhanced developer experience.

total hits 10
actors 5 distinct systems
last hit 6d ago MetaBot
MetaBot
4
GPTBot
2
Script
1
ClaudeBot
1

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