Merge branch '5.99' into 6.0
This commit is contained in:
@@ -7,13 +7,11 @@ jasmineRequire.HtmlReporter = function(j$) {
|
||||
this.specsExecuted = 0;
|
||||
this.failureCount = 0;
|
||||
this.pendingSpecCount = 0;
|
||||
this.suitesById = [];
|
||||
}
|
||||
|
||||
ResultsStateBuilder.prototype.suiteStarted = function(result) {
|
||||
this.currentParent.addChild(result, 'suite');
|
||||
this.currentParent = this.currentParent.last();
|
||||
this.suitesById[result.id] = this.currentParent;
|
||||
};
|
||||
|
||||
ResultsStateBuilder.prototype.suiteDone = function(result) {
|
||||
@@ -66,14 +64,10 @@ jasmineRequire.HtmlReporter = function(j$) {
|
||||
const getContainer = options.getContainer;
|
||||
const createElement = options.createElement;
|
||||
const createTextNode = options.createTextNode;
|
||||
// TODO: in the next major release, replace navigateWithNewParam and
|
||||
// addToExistingQueryString with direct usage of options.queryString
|
||||
const navigateWithNewParam = options.navigateWithNewParam || function() {};
|
||||
const addToExistingQueryString =
|
||||
options.addToExistingQueryString || defaultQueryString;
|
||||
const filterSpecs = options.queryString
|
||||
? !!options.queryString.getParam('spec')
|
||||
: options.filterSpecs; // For compatibility with pre-5.11 boot files
|
||||
const filterSpecs = options.filterSpecs;
|
||||
let htmlReporterMain;
|
||||
let symbols;
|
||||
const deprecationWarnings = [];
|
||||
@@ -702,6 +696,21 @@ jasmineRequire.HtmlReporter = function(j$) {
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
function suiteHref(suite) {
|
||||
const els = [];
|
||||
|
||||
while (suite && suite.parent) {
|
||||
els.unshift(suite.result.description);
|
||||
suite = suite.parent;
|
||||
}
|
||||
|
||||
// include window.location.pathname to fix issue with karma-jasmine-html-reporter in angular: see https://github.com/jasmine/jasmine/issues/1906
|
||||
return (
|
||||
(window.location.pathname || '') +
|
||||
addToExistingQueryString('spec', els.join(' '))
|
||||
);
|
||||
}
|
||||
|
||||
function addDeprecationWarnings(result, runnableType) {
|
||||
if (result && result.deprecationWarnings) {
|
||||
for (let i = 0; i < result.deprecationWarnings.length; i++) {
|
||||
@@ -799,33 +808,11 @@ jasmineRequire.HtmlReporter = function(j$) {
|
||||
return '' + count + ' ' + word;
|
||||
}
|
||||
|
||||
function suitePath(suite) {
|
||||
const els = [];
|
||||
|
||||
while (suite && suite.parent) {
|
||||
els.unshift(suite.result.description);
|
||||
suite = suite.parent;
|
||||
}
|
||||
|
||||
return els;
|
||||
}
|
||||
|
||||
function suiteHref(suite) {
|
||||
return pathHref(suitePath(suite));
|
||||
}
|
||||
|
||||
function specHref(result) {
|
||||
const suite = stateBuilder.suitesById[result.parentSuiteId];
|
||||
const path = suitePath(suite);
|
||||
path.push(result.description);
|
||||
return pathHref(path);
|
||||
}
|
||||
|
||||
function pathHref(path) {
|
||||
// include window.location.pathname to fix issue with karma-jasmine-html-reporter in angular: see https://github.com/jasmine/jasmine/issues/1906
|
||||
return (
|
||||
(window.location.pathname || '') +
|
||||
addToExistingQueryString('spec', JSON.stringify(path))
|
||||
addToExistingQueryString('spec', result.fullName)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user