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

fix: Remove escaping character in CDATA #25

Merged
merged 1 commit into from
Nov 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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