Browse Source

[build]

master
Muthu Kumar 6 years ago
parent
commit
a90706dcf4
  1. 19
      browser/index.js
  2. 19
      es5/reporters/xunit.js
  3. 2
      package.json

19
browser/index.js

@ -2442,6 +2442,10 @@ function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.itera
var _require9 = require('../util/nodeutils'),
clear = _require9.clear;
var escapeXML = function escapeXML(str) {
return str.replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
};
var toJSON = function toJSON(resultsArray) {
return {
testsuites: resultsArray.map(function (results) {
@ -2453,7 +2457,7 @@ function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.itera
return {
name: 'testsuite',
attrs: {
name: name,
name: escapeXML(name),
tests: count,
success: success.length,
failures: failures.length,
@ -2463,20 +2467,17 @@ function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.itera
},
children: results.reduce(function (acc, r) {
var reason = r.reason ? r.reason.stack || r.reason : '';
var content = r.status !== 'ok' && r.status === 'skip' ? {
name: 'skipped',
text: reason
} : {
name: 'failure',
text: reason
var content = r.status !== 'ok' && {
name: r.status === 'skip' ? 'skipped' : 'failure',
text: escapeXML(reason)
};
acc.push(_objectSpread({
name: 'testcase',
attrs: {
name: r.description,
name: escapeXML(r.description),
time: r.duration / 1000 || 0
}
}, _typeof2(content) === 'object' && content, _typeof2(content) === 'object' && {
}, _typeof2(content) === 'object' && {
children: [content]
}));
return acc;

19
es5/reporters/xunit.js

@ -11,6 +11,10 @@ var toXML = require('jsontoxml');
var _require = require('../util/nodeutils'),
clear = _require.clear;
var escapeXML = function escapeXML(str) {
return str.replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
};
var toJSON = function toJSON(resultsArray) {
return {
testsuites: resultsArray.map(function (results) {
@ -22,7 +26,7 @@ var toJSON = function toJSON(resultsArray) {
return {
name: 'testsuite',
attrs: {
name: name,
name: escapeXML(name),
tests: count,
success: success.length,
failures: failures.length,
@ -32,20 +36,17 @@ var toJSON = function toJSON(resultsArray) {
},
children: results.reduce(function (acc, r) {
var reason = r.reason ? r.reason.stack || r.reason : '';
var content = r.status !== 'ok' && r.status === 'skip' ? {
name: 'skipped',
text: reason
} : {
name: 'failure',
text: reason
var content = r.status !== 'ok' && {
name: r.status === 'skip' ? 'skipped' : 'failure',
text: escapeXML(reason)
};
acc.push(_objectSpread({
name: 'testcase',
attrs: {
name: r.description,
name: escapeXML(r.description),
time: r.duration / 1000 || 0
}
}, _typeof(content) === 'object' && content, _typeof(content) === 'object' && {
}, _typeof(content) === 'object' && {
children: [content]
}));
return acc;

2
package.json

@ -1,6 +1,6 @@
{
"name": "@klenty/gunner",
"version": "0.11.10",
"version": "0.11.11",
"description": "Zero magic, fast test-runner and assertion framework. No magic globals.",
"main": "index.js",
"repository": {

Loading…
Cancel
Save