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

HTML reporter fails if some Unicode characters are in use, causing tests to stop running #1893

Open
jcranmer opened this issue Sep 16, 2015 · 1 comment
Labels
area: browser browser-specific area: reporters involving a specific reporter status: accepting prs Mocha can use your help with this one! type: bug a defect, confirmed by a maintainer

Comments

@jcranmer
Copy link

I was working on a project that ran test vectors of the IdnaTest.txt Unicode data file, and I noticed that when certain Unicode characters were in use, the HTML reporter (but not the standard node.js reporters) would stop working properly. An example of such a test case is:

test('T;  퀬-\uDF7E\uD9AE\uDD23.\u200C\uD804\uDD33\uD95B\uDF38𝟤;  [P1 V6 C1]; [P1 V6 V5 A3]', function () {
  assert.throws(function () { toUnicode("퀬-\uDF7E\uD9AE\uDD23.\u200C\uD804\uDD33\uD95B\uDF38𝟤", true); });
  assert.throws(function () { toAscii("퀬-\uDF7E\uD9AE\uDD23.\u200C\uD804\uDD33\uD95B\uDF38𝟤", true); });
});

After laboriously trying to catch it in a debugger (I originally found this in a test case where I dynamically generated the functions, so I had to first write another preprocessing step to dump code to a file), I found that the problem was that there was a URIError that was thrown. Unfortunately, I don't have the exact error message or its exact location.

While I do understand that using random Unicode is likely to cause lots of issues, it would be nice to see the actual characters involved for debugging purposes, so I do like using crazy raw test names if possible.

@drazisil drazisil added area: reporters involving a specific reporter unconfirmed labels Mar 30, 2017
@ScottFreeCode ScottFreeCode added area: browser browser-specific type: bug a defect, confirmed by a maintainer labels Sep 22, 2017
@JoshuaKGoldberg
Copy link
Member

I can confirm this bug still exists right now. When I add the OP's code after the it("2 + 2" in mochajs/mocha-examples#72, the page only reports the it("2 + 2". Not this new case.

@JoshuaKGoldberg JoshuaKGoldberg added status: accepting prs Mocha can use your help with this one! and removed unconfirmed-bug labels Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: browser browser-specific area: reporters involving a specific reporter status: accepting prs Mocha can use your help with this one! type: bug a defect, confirmed by a maintainer
Projects
None yet
Development

No branches or pull requests

4 participants