clear prior test results on multiple inits

This commit is contained in:
Luke van der Hoeven
2014-05-23 15:59:56 -04:00
parent 6750559211
commit 07cce0b1d1

View File

@@ -20,6 +20,7 @@ jasmineRequire.HtmlReporter = function(j$) {
symbols;
this.initialize = function() {
clearPrior();
htmlReporterMain = createDom('div', {className: 'html-reporter'},
createDom('div', {className: 'banner'},
createDom('a', {className: 'title', href: 'http://jasmine.github.io/', target: '_blank'}),
@@ -220,6 +221,15 @@ jasmineRequire.HtmlReporter = function(j$) {
return getContainer().querySelector('.html-reporter ' + selector);
}
function clearPrior() {
// return the reporter
var oldReporter = find('');
if(oldReporter) {
getContainer().removeChild(oldReporter);
}
}
function createDom(type, attrs, childrenVarArgs) {
var el = createElement(type);