visionmedia/mocha — pull request #640 by jsalonen (2012-11-04 20:43:42+00:00)
Title: With node.js on Windows: use symbols available in terminal default fonts

This pull request fixes - imho - a major annoyance with Mocha when running with node.js on Windows.

Several reporters (`dot`, `list` and `spec`) use special unicode symbols for visualising check marks (`✓`), error marks (`✖`) and small dots (`․`).

Sadly, default terminal fonts for Windows don't support these symbols. While mocha itself works just fine regardless, it is somewhat annoying your console gets filled with odd placeholder characters. This problem can be worked around by installing a custom font, such as DeJavu Sans Mono (). Given this requires extra work, I'm pretty sure many developers just live with the broken symbols.

This pull request introduces the fix for this annoying problem as follows:

- A new, common symbol map containing symbols for check mark, error mark and small dots has been added to `reporters/base.js`
- In case Node.js/Windows are detected, the default symbol map is modified to fall back to use symbols that are readily available on default console fonts
- Reporters (`dot`, `list`, `spec`) have been modified to use special symbols from the symbol map