Skip to content

Commit

Permalink
fix: Remove escaping character in CDATA (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
jugend committed Nov 24, 2021
1 parent c8ed187 commit 73b2db7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/xunit-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function XUnitFile(runner) {
if( process.env.XUNIT_LOG_ENV) {
logProperties(fd);
}

tests.forEach(function(test){
writeTest(fd, test);
});
Expand All @@ -106,7 +106,7 @@ function XUnitFile(runner) {
XUnitFile.prototype.__proto__ = Base.prototype;

/**
* Writes a list of process and environment variables to the <properties> section in the XML.
* Writes a list of process and environment variables to the <properties> section in the XML.
*/
function logProperties(fd) {
var attrs = new Object();
Expand All @@ -131,15 +131,15 @@ function logProperties(fd) {
}

/**
* Formats a single property value.
* Formats a single property value.
*/

function logProperty( name, value) {
return ' ' + tag('property', { name: name, value: value }, true) + '\n';
}

/**
* Simple utility to convert a flat Object to a readable string.
* Simple utility to convert a flat Object to a readable string.
*/

function objectToString( obj) {
Expand Down Expand Up @@ -200,11 +200,11 @@ function tag(name, attrs, close, content) {
}

/**
* Return cdata escaped CDATA `str`.
* Return CDATA `str`.
*/

function cdata(str) {
return '<![CDATA[' + escape(str) + ']]>';
return '<![CDATA[' + str + ']]>';
}

function appendLine(fd, line) {
Expand Down

0 comments on commit 73b2db7

Please sign in to comment.