mocha
mocha copied to clipboard
[WSL] Test report corruption
Prerequisites
- [x] Checked that your issue hasn't already been filed by cross-referencing issues with the
faq
label - [x] Checked next-gen ES issues and syntax problems by using the same environment and/or transpiler configuration without Mocha to ensure it isn't just a feature that actually isn't supported in the environment in question or a bug in your code.
- [x] 'Smoke tested' the code to be tested by running it outside the real test suite to get a better sense of whether the problem is in the code under test, your usage of Mocha, or Mocha itself
- [x] Ensured that there is no discrepancy between the locally and globally installed versions of Mocha. You can find them with:
node node_modules/.bin/mocha --version
(Local) andmocha --version
(Global). We recommend that you not install Mocha globally.
Description
The checkmark and ex symbols used by mocha, don't render well in many Windows shell environments. For example, in Windows Subsystem for Linux, they show up as the missing Unicode question mark glyph.
Steps to Reproduce
Use mocha in WSL.
Expected behavior: The report renders successfully.
Actual behavior: Special characters are mangled.
Reproduces how often: 100%
Versions
-
The output of
mocha --version
andnode node_modules/.bin/mocha --version
: 6.2.0 -
The output of
node --version
: 8.16.0 -
Your operating system
- name and version: Windows 10
- architecture (32 or 64-bit): 64
-
Your shell (e.g., bash, zsh, PowerShell, cmd): zsh inside Ubuntu inside WSL inside Windows 10.
Additional Information
Recommended to detect WSL, and use plain ASCII characters in this case. The number of Windows shell environments that don't support Unicode characters well, far outnumbers the Windows shell environments that do.
This sounds plausible. You can see the same issue when using "Git Bash" under Windows. The fix would live in lib/reporters/base.js
, whatever it is--but we probably want to detect terminal capabilities (encoding?) instead of whatever we're doing.
IMO we should consume log-symbols here; we already use it (elsewhere).
Hello
I tried to reproduce this issue. And I found some reason.
My operating system
name and version: Windows 10
architecture (32 or 64-bit): 64
Your shell (e.g., bash, zsh, PowerShell, cmd): Git Bash
In conclusion, when running node, if it is executed with double quotes like "node"
, the report will collapse
This seems to be a problem with any reports other as well as Mocha.
This is the situation
This was not solved using log-symbols
.
And this had no problem when using cmd
or powershell
.
Using log-symbols
still is good for removing routine for win32 about symbols IMO
Hello I am a first timer. Can anyone help regarding this issue?
changing the output is a breaking change. I expect it to land in mocha v9. will take a look at the PR before then
I'm working on Windows/WSL 2.0 and can't confirm this rendering issue anymore.
Meanwhile we also have switched to using log-symbols
.
We aren't going to pursue this issue any further. Trying to handle rendering deficiencies of individuell shells is out of Mocha's scope.