Merge branch 'master' into 3.0-features

- cleaning up 2.99 deprecations
This commit is contained in:
Gregg Van Hove
2018-02-05 17:12:18 -08:00
13 changed files with 218 additions and 6 deletions

View File

@@ -60,7 +60,8 @@ jasmineRequire.HtmlReporter = function(j$) {
filterSpecs = options.filterSpecs,
timer = options.timer || noopTimer,
htmlReporterMain,
symbols;
symbols,
deprecationWarnings = [];
this.initialize = function() {
clearPrior();
@@ -98,6 +99,7 @@ jasmineRequire.HtmlReporter = function(j$) {
if (result.status === 'failed') {
failures.push(failureDom(result));
}
addDeprecationWarnings(result);
};
this.specStarted = function(result) {
@@ -126,6 +128,8 @@ jasmineRequire.HtmlReporter = function(j$) {
if (result.status === 'failed') {
failures.push(failureDom(result));
}
addDeprecationWarnings(result);
};
this.jasmineDone = function(doneResult) {
@@ -195,6 +199,14 @@ jasmineRequire.HtmlReporter = function(j$) {
}
}
addDeprecationWarnings(doneResult);
var warningBarClassName = 'jasmine-bar jasmine-warning';
for(i = 0; i < deprecationWarnings.length; i++) {
var warning = deprecationWarnings[i];
alert.appendChild(createDom('span', {className: warningBarClassName}, 'DEPRECATION: ' + warning));
}
var results = find('.jasmine-results');
results.appendChild(summary);
@@ -375,6 +387,17 @@ jasmineRequire.HtmlReporter = function(j$) {
return addToExistingQueryString('spec', els.join(' '));
}
function addDeprecationWarnings(result) {
if (result && result.deprecationWarnings) {
for(var i = 0; i < result.deprecationWarnings.length; i++) {
var warning = result.deprecationWarnings[i].message;
if (!j$.util.arrayContains(warning)) {
deprecationWarnings.push(warning);
}
}
}
}
function find(selector) {
return getContainer().querySelector('.jasmine_html-reporter ' + selector);
}