Skip to content

Commit

Permalink
Avoid double and triple xUnit XML escaping (#2178)
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert authored and dasilvacontin committed May 23, 2016
1 parent 015b809 commit 49b5ff1
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions lib/reporters/xunit.js
Expand Up @@ -130,7 +130,7 @@ XUnit.prototype.test = function(test) {

if (test.state === 'failed') {
var err = test.err;
this.write(tag('testcase', attrs, false, tag('failure', {}, false, cdata(escape(err.message) + '\n' + err.stack))));
this.write(tag('testcase', attrs, false, tag('failure', {}, false, escape(err.message) + '\n' + escape(err.stack))));
} else if (test.isPending()) {
this.write(tag('testcase', attrs, false, tag('skipped', {}, true)));
} else {
Expand Down Expand Up @@ -164,11 +164,3 @@ function tag(name, attrs, close, content) {
}
return tag;
}

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

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

0 comments on commit 49b5ff1

Please sign in to comment.