From 49b5ff1508dd8c0a84e6b2c20e49c50f8b6a1578 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Mon, 23 May 2016 20:25:51 +0100 Subject: [PATCH] Avoid double and triple xUnit XML escaping (#2178) --- lib/reporters/xunit.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/reporters/xunit.js b/lib/reporters/xunit.js index 875d592876..1cfd8f4f51 100644 --- a/lib/reporters/xunit.js +++ b/lib/reporters/xunit.js @@ -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 { @@ -164,11 +164,3 @@ function tag(name, attrs, close, content) { } return tag; } - -/** - * Return cdata escaped CDATA `str`. - */ - -function cdata(str) { - return ''; -}