aghassemi/tap-xunit

Missing string sanitation before passing failure text to xmlbuilder

bencon opened this issue · 0 comments

line 33 in lib/serialize.js:
failureElement.txt(formatFailure(a.diag));

is prone to passing unicode characters that xmlbuilder can't handle which can cause tap-xunit to throw an error such as:

node_modules\tap-xunit\node_modules\xmlbuilder\lib\XMLStringifier.js:149
15:21:40 throw new Error("Invalid character (" + chr + ") in string: " + str + " at index " + chr.index);
15:21:40 ^
15:21:40
15:21:40 Error: Invalid character (�) in string:

As a result, no test results are generated.

The following pull request fixes the issue:
Add missing string sanitation #26