-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix broken symbols when using node.js on Windows with default terminal fonts #641
Conversation
+1 |
@@ -277,7 +293,7 @@ Base.prototype.epilogue = function(){ | |||
|
|||
// failure | |||
if (stats.failures) { | |||
fmt = color('bright fail', ' ✖') | |||
fmt = color('bright fail', ' '+exports.symbols.err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
' + exports..
windows should die, but ill merge after the style stuff is fixed |
Thanks! Fixed. Also modified progress reporter similarly. |
merged! thanks man |
Thanks mate! This is awesome. |
Great, now we have to include two sets of test fixtures, one for win32 and one for the rest of the platforms that are doing it correctly 😁 |
chcp 65001 anyone before running mocha? or will this not work? |
This pull request fixes - imho - a major annoyance with Mocha when running with node.js on Windows.
Several reporters (
dot
,list
andspec
) 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, it is somewhat annoying that your console gets filled with odd placeholder characters. This problem can be worked around by installing a custom font, such as DeJavu Sans Mono (http://stackoverflow.com/questions/9817926/how-can-i-get-mochas-unicode-output-to-display-properly-in-a-windows-console). Given this requires extra work, I'm pretty sure many developers just live with the broken symbols.
This pull request introduces a fix to this problem as follows:
reporters/base.js
dot
,list
,spec
) have been modified to use special symbols from the symbol map