Browse Source

[reporter] minor workaround for xml escaping

master
Muthu Kumar 6 years ago
parent
commit
aa9214cb04
  1. 2
      src/lib/assertionsLibrary.js
  2. 6
      src/reporters/xunit.js

2
src/lib/assertionsLibrary.js

@ -65,7 +65,7 @@ module.exports.hasProp =
module.exports.hasPair = module.exports.hasPair =
[ [
(val, ...pair) => isEq(val[pair[0]], pair[1]), (val, ...pair) => isEq(val[pair[0]], pair[1]),
(val, ...pair) => _`<${pair}> does not exist in ${val}`, (val, ...pair) => _`${pair} does not exist in ${val}`,
]; ];
module.exports.isPromise = module.exports.isPromise =
[ [

6
src/reporters/xunit.js

@ -11,7 +11,6 @@ const tag = (name, attrs, close, content) => {
tag = "<" + name + (pairs.length ? " " + pairs.join(" ") : "") + end; tag = "<" + name + (pairs.length ? " " + pairs.join(" ") : "") + end;
if (content) { if (content) {
// content = content instanceof String ? content : escape(content);
tag += content + "</" + name + end; tag += content + "</" + name + end;
} }
return new String(tag); return new String(tag);
@ -28,6 +27,7 @@ const convert = results => {
tag( tag(
'testsuite', 'testsuite',
{ {
name: results.name,
tests: count, tests: count,
success: success.length, success: success.length,
failures: failures.length, failures: failures.length,
@ -41,10 +41,10 @@ const convert = results => {
? tag('skipped', {}, true) ? tag('skipped', {}, true)
: tag( : tag(
'failure', {}, 'failure', {},
!r.reason, r.reason ? escape(r.reason) : '')); !r.reason, r.reason ? r.reason : ''));
acc += tag( acc += tag(
'testcase', 'testcase',
{ name: escape(r.description) }, { name: r.description },
close, close,
content || '' content || ''
); );

Loading…
Cancel
Save