mocha-clean is a plugin for Mocha. It strips away mocha internals,
node_modules, absolute paths (based on cwd), and other unneccessary cruft
from stack traces.
Simply invoke Mocha with
-r mocha-clean. The easiest way to do this is to add
it to your test/mocha.opts file.
It’s available via npm, and works with Mocha 1.x in Node.js and in the browser. The source is available in GitHub: rstacruz/mocha-clean.
npm install --save-dev mocha-clean
Merging into Mocha?
A pull request is currently open in Mocha to integrate this functionality into Mocha itself. Check out #1564 and offer your support and comments.