HTML reporter: cache configuration throughout each run
This commit is contained in:
@@ -126,6 +126,7 @@ jasmineRequire.HtmlReporter = function(j$) {
|
||||
#urlBuilder;
|
||||
#filterSpecs;
|
||||
#stateBuilder;
|
||||
#config;
|
||||
#htmlReporterMain;
|
||||
|
||||
// Sub-views
|
||||
@@ -157,13 +158,12 @@ jasmineRequire.HtmlReporter = function(j$) {
|
||||
*/
|
||||
initialize() {
|
||||
this.#clearPrior();
|
||||
this.#config = this.#env ? this.#env.configuration() : {};
|
||||
|
||||
this.#stateBuilder = new ResultsStateBuilder();
|
||||
|
||||
this.#alerts = new AlertsView(this.#domContext, this.#urlBuilder);
|
||||
this.#symbols = new SymbolsView(
|
||||
this.#domContext,
|
||||
this.#config.bind(this)
|
||||
);
|
||||
this.#symbols = new SymbolsView(this.#domContext);
|
||||
this.#banner = new Banner(this.#domContext, this.#navigateWithNewParam);
|
||||
this.#failures = new FailuresView(this.#domContext, this.#urlBuilder);
|
||||
this.#htmlReporterMain = this.#domContext.create(
|
||||
@@ -197,7 +197,7 @@ jasmineRequire.HtmlReporter = function(j$) {
|
||||
|
||||
specDone(result) {
|
||||
this.#stateBuilder.specDone(result);
|
||||
this.#symbols.append(result, this.#config());
|
||||
this.#symbols.append(result, this.#config);
|
||||
|
||||
if (noExpectations(result)) {
|
||||
const noSpecMsg = "Spec '" + result.fullName + "' has no expectations.";
|
||||
@@ -218,7 +218,7 @@ jasmineRequire.HtmlReporter = function(j$) {
|
||||
jasmineDone(doneResult) {
|
||||
this.#stateBuilder.jasmineDone(doneResult);
|
||||
this.#alerts.addDuration(doneResult.totalTime);
|
||||
this.#banner.showOptionsMenu(this.#config());
|
||||
this.#banner.showOptionsMenu(this.#config);
|
||||
|
||||
if (
|
||||
this.#stateBuilder.specsExecuted < this.#stateBuilder.totalSpecsDefined
|
||||
@@ -261,10 +261,6 @@ jasmineRequire.HtmlReporter = function(j$) {
|
||||
}
|
||||
}
|
||||
|
||||
#config() {
|
||||
return (this.#env && this.#env.configuration()) || {};
|
||||
}
|
||||
|
||||
#find(selector) {
|
||||
return this.#getContainer().querySelector(
|
||||
'.jasmine_html-reporter ' + selector
|
||||
|
||||
@@ -91,6 +91,7 @@ jasmineRequire.HtmlReporter = function(j$) {
|
||||
#urlBuilder;
|
||||
#filterSpecs;
|
||||
#stateBuilder;
|
||||
#config;
|
||||
#htmlReporterMain;
|
||||
|
||||
// Sub-views
|
||||
@@ -122,13 +123,12 @@ jasmineRequire.HtmlReporter = function(j$) {
|
||||
*/
|
||||
initialize() {
|
||||
this.#clearPrior();
|
||||
this.#config = this.#env ? this.#env.configuration() : {};
|
||||
|
||||
this.#stateBuilder = new ResultsStateBuilder();
|
||||
|
||||
this.#alerts = new AlertsView(this.#domContext, this.#urlBuilder);
|
||||
this.#symbols = new SymbolsView(
|
||||
this.#domContext,
|
||||
this.#config.bind(this)
|
||||
);
|
||||
this.#symbols = new SymbolsView(this.#domContext);
|
||||
this.#banner = new Banner(this.#domContext, this.#navigateWithNewParam);
|
||||
this.#failures = new FailuresView(this.#domContext, this.#urlBuilder);
|
||||
this.#htmlReporterMain = this.#domContext.create(
|
||||
@@ -162,7 +162,7 @@ jasmineRequire.HtmlReporter = function(j$) {
|
||||
|
||||
specDone(result) {
|
||||
this.#stateBuilder.specDone(result);
|
||||
this.#symbols.append(result, this.#config());
|
||||
this.#symbols.append(result, this.#config);
|
||||
|
||||
if (noExpectations(result)) {
|
||||
const noSpecMsg = "Spec '" + result.fullName + "' has no expectations.";
|
||||
@@ -183,7 +183,7 @@ jasmineRequire.HtmlReporter = function(j$) {
|
||||
jasmineDone(doneResult) {
|
||||
this.#stateBuilder.jasmineDone(doneResult);
|
||||
this.#alerts.addDuration(doneResult.totalTime);
|
||||
this.#banner.showOptionsMenu(this.#config());
|
||||
this.#banner.showOptionsMenu(this.#config);
|
||||
|
||||
if (
|
||||
this.#stateBuilder.specsExecuted < this.#stateBuilder.totalSpecsDefined
|
||||
@@ -226,10 +226,6 @@ jasmineRequire.HtmlReporter = function(j$) {
|
||||
}
|
||||
}
|
||||
|
||||
#config() {
|
||||
return (this.#env && this.#env.configuration()) || {};
|
||||
}
|
||||
|
||||
#find(selector) {
|
||||
return this.#getContainer().querySelector(
|
||||
'.jasmine_html-reporter ' + selector
|
||||
|
||||
Reference in New Issue
Block a user