pulsar/spec/jasmine-junit-reporter.js
2019-05-31 18:33:56 +02:00

22 lines
557 B
JavaScript

require('jasmine-reporters');
class JasmineJUnitReporter extends jasmine.JUnitXmlReporter {
fullDescription(spec) {
let fullDescription = spec.description;
let currentSuite = spec.suite;
while (currentSuite) {
fullDescription = currentSuite.description + ' ' + fullDescription;
currentSuite = currentSuite.parentSuite;
}
return fullDescription;
}
reportSpecResults(spec) {
spec.description = this.fullDescription(spec);
return super.reportSpecResults(spec);
}
}
module.exports = { JasmineJUnitReporter };