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