Skip to content

Commit 49b5ff1

Browse files
graingertdasilvacontin
authored andcommittedMay 23, 2016
Avoid double and triple xUnit XML escaping (#2178)
1 parent 015b809 commit 49b5ff1

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed
 

‎lib/reporters/xunit.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ XUnit.prototype.test = function(test) {
130130

131131
if (test.state === 'failed') {
132132
var err = test.err;
133-
this.write(tag('testcase', attrs, false, tag('failure', {}, false, cdata(escape(err.message) + '\n' + err.stack))));
133+
this.write(tag('testcase', attrs, false, tag('failure', {}, false, escape(err.message) + '\n' + escape(err.stack))));
134134
} else if (test.isPending()) {
135135
this.write(tag('testcase', attrs, false, tag('skipped', {}, true)));
136136
} else {
@@ -164,11 +164,3 @@ function tag(name, attrs, close, content) {
164164
}
165165
return tag;
166166
}
167-
168-
/**
169-
* Return cdata escaped CDATA `str`.
170-
*/
171-
172-
function cdata(str) {
173-
return '<![CDATA[' + escape(str) + ']]>';
174-
}

0 commit comments

Comments
 (0)
Please sign in to comment.