Skip to content
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

[WSL] Test report corruption #4353

Closed
4 tasks done
mcandre opened this issue Jun 26, 2020 · 6 comments
Closed
4 tasks done

[WSL] Test report corruption #4353

mcandre opened this issue Jun 26, 2020 · 6 comments
Labels
area: windows Windows-specific type: bug a defect, confirmed by a maintainer

Comments

@mcandre
Copy link

mcandre commented Jun 26, 2020

Prerequisites

  • Checked that your issue hasn't already been filed by cross-referencing issues with the faq label
  • 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.
  • '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
  • 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) and mocha --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 and node 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.

@boneskull
Copy link
Member

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.

@boneskull boneskull added type: bug a defect, confirmed by a maintainer good first issue new contributors should look here! status: accepting prs Mocha can use your help with this one! area: windows Windows-specific and removed unconfirmed-bug labels Jun 30, 2020
@boneskull
Copy link
Member

IMO we should consume log-symbols here; we already use it (elsewhere).

@MoonSupport
Copy link
Contributor

MoonSupport commented Jul 25, 2020

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
KakaoTalk_Photo_2020-07-25-18-46-26

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

@Blakelist7
Copy link

Hello
I am a first timer. Can anyone help regarding this issue?

@boneskull
Copy link
Member

changing the output is a breaking change. I expect it to land in mocha v9. will take a look at the PR before then

@juergba
Copy link
Member

juergba commented Oct 16, 2022

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.

@juergba juergba closed this as completed Oct 16, 2022
@juergba juergba removed status: accepting prs Mocha can use your help with this one! good first issue new contributors should look here! labels Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: windows Windows-specific type: bug a defect, confirmed by a maintainer
Projects
None yet
Development

No branches or pull requests

5 participants