function DisplayProcessor(configuration) {
this.configuration = configuration;
}n/a
function SpecReporter(configuration) {
this.specs = {
failed: [],
pending: [],
successful: []
};
this.configuration = configuration_parser_1.ConfigurationParser.parse(configuration);
var displayProcessors = SpecReporter.initProcessors(this.configuration);
var print = this.configuration.print;
this.logger = new logger_1.Logger(displayProcessors, print);
this.display = new execution_display_1.ExecutionDisplay(this.configuration, this.logger, this.specs, displayProcessors);
this.summary = new summary_display_1.SummaryDisplay(this.logger, this.configuration, this.specs);
this.metrics = new execution_metrics_1.ExecutionMetrics();
}n/a
function DisplayProcessor(configuration) {
this.configuration = configuration;
}n/a
displayFailedSpec = function (spec, log) {
return log;
}...
}
};
ExecutionDisplay.prototype.failed = function (result) {
this.failedSpecs.push(result);
if (this.configuration.spec.displayFailed) {
this.ensureSuiteDisplayed();
this.process(result, function (displayProcessor, object, log) {
return displayProcessor.displayFailedSpec(object, log);
});
if (this.configuration.spec.displayErrorMessages) {
this.increaseIndent();
this.process(result, function (displayProcessor, object, log) {
return displayProcessor.displaySpecErrorMessages(object, log);
});
this.decreaseIndent();
...displayJasmineStarted = function (info, log) {
return log;
}...
var result = processor.displaySpecStarted({ id: "bar", description: "bar", fullName: "bar" },
log);
isDisplayed = isDisplayed || result !== log;
});
return isDisplayed;
};
ExecutionDisplay.prototype.jasmineStarted = function (suiteInfo) {
this.process(suiteInfo, function (displayProcessor, object, log) {
return displayProcessor.displayJasmineStarted(object, log);
});
};
ExecutionDisplay.prototype.summary = function (metrics) {
var pluralizedSpec = (metrics.totalSpecsDefined === 1 ? " spec" : " specs");
var execution = "Executed " + metrics.executedSpecs + " of " + metrics.totalSpecsDefined + pluralizedSpec
;
var successful = (metrics.failedSpecs === 0) ? " SUCCESS" : "";
var failed = (metrics.failedSpecs > 0) ? " (" + metrics.failedSpecs + " FAILED)" : "";
...displayPendingSpec = function (spec, log) {
return log;
}...
}
};
ExecutionDisplay.prototype.pending = function (result) {
this.pendingSpecs.push(result);
if (this.configuration.spec.displayPending) {
this.ensureSuiteDisplayed();
this.process(result, function (displayProcessor, object, log) {
return displayProcessor.displayPendingSpec(object, log);
});
}
};
ExecutionDisplay.prototype.suiteStarted = function (result) {
this.suiteHierarchy.push(result);
};
ExecutionDisplay.prototype.suiteDone = function () {
...displaySpecErrorMessages = function (spec, log) {
return log;
}...
this.ensureSuiteDisplayed();
this.process(result, function (displayProcessor, object, log) {
return displayProcessor.displayFailedSpec(object, log);
});
if (this.configuration.spec.displayErrorMessages) {
this.increaseIndent();
this.process(result, function (displayProcessor, object, log) {
return displayProcessor.displaySpecErrorMessages(object, log);
});
this.decreaseIndent();
}
}
};
ExecutionDisplay.prototype.pending = function (result) {
this.pendingSpecs.push(result);
...displaySpecStarted = function (spec, log) {
return log;
}...
}
return displayProcessors;
};
ExecutionDisplay.hasCustomDisplaySpecStarted = function (processors) {
var isDisplayed = false;
processors.forEach(function (processor) {
var log = "foo";
var result = processor.displaySpecStarted({ id: "bar", description:
x22;bar", fullName: "bar" }, log);
isDisplayed = isDisplayed || result !== log;
});
return isDisplayed;
};
ExecutionDisplay.prototype.jasmineStarted = function (suiteInfo) {
this.process(suiteInfo, function (displayProcessor, object, log) {
return displayProcessor.displayJasmineStarted(object, log);
...displaySuccessfulSpec = function (spec, log) {
return log;
}...
}
};
ExecutionDisplay.prototype.successful = function (result) {
this.successfulSpecs.push(result);
if (this.configuration.spec.displaySuccessful) {
this.ensureSuiteDisplayed();
this.process(result, function (displayProcessor, object, log) {
return displayProcessor.displaySuccessfulSpec(object, log);
});
}
};
ExecutionDisplay.prototype.failed = function (result) {
this.failedSpecs.push(result);
if (this.configuration.spec.displayFailed) {
this.ensureSuiteDisplayed();
...displaySuite = function (suite, log) {
return log;
}...
this.log(pendingReason.pending);
this.resetIndent();
};
ExecutionDisplay.prototype.ensureSuiteDisplayed = function () {
if (this.suiteHierarchy.length !== 0) {
for (var i = this.suiteHierarchyDisplayed.length; i < this.suiteHierarchy.length; i++) {
this.suiteHierarchyDisplayed.push(this.suiteHierarchy[i]);
this.displaySuite(this.suiteHierarchy[i]);
}
}
else {
var name_1 = "Top level suite";
var topLevelSuite = {
description: name_1,
fullName: name_1,
...displaySummaryErrorMessages = function (spec, log) {
return log;
}...
this.resetIndent();
};
ExecutionDisplay.prototype.failedSummary = function (spec, index) {
this.log(index + ") " + spec.fullName);
if (this.configuration.summary.displayErrorMessages) {
this.increaseIndent();
this.process(spec, function (displayProcessor, object, log) {
return displayProcessor.displaySummaryErrorMessages(object, log);
});
this.decreaseIndent();
}
};
ExecutionDisplay.prototype.pendingsSummary = function () {
this.log("**************************************************");
this.log("* Pending *");
...function SpecReporter(configuration) {
this.specs = {
failed: [],
pending: [],
successful: []
};
this.configuration = configuration_parser_1.ConfigurationParser.parse(configuration);
var displayProcessors = SpecReporter.initProcessors(this.configuration);
var print = this.configuration.print;
this.logger = new logger_1.Logger(displayProcessors, print);
this.display = new execution_display_1.ExecutionDisplay(this.configuration, this.logger, this.specs, displayProcessors);
this.summary = new summary_display_1.SummaryDisplay(this.logger, this.configuration, this.specs);
this.metrics = new execution_metrics_1.ExecutionMetrics();
}n/a
initProcessors = function (configuration) {
var displayProcessors = [
new default_processor_1.DefaultProcessor(configuration),
new spec_prefixes_processor_1.SpecPrefixesProcessor(configuration),
new spec_colors_processor_1.SpecColorsProcessor(configuration),
];
if (configuration.spec.displayDuration) {
displayProcessors.push(new spec_durations_processor_1.SpecDurationsProcessor(configuration));
}
if (configuration.suite.displayNumber) {
displayProcessors.push(new suite_numbering_processor_1.SuiteNumberingProcessor(configuration));
}
if (configuration.customProcessors) {
configuration.customProcessors.forEach(function (Processor) {
displayProcessors.push(new Processor(configuration));
});
}
return displayProcessors;
}...
this.suiteHierarchy = [];
this.suiteHierarchyDisplayed = [];
this.successfulSpecs = [];
this.failedSpecs = [];
this.pendingSpecs = [];
this.lastWasNewLine = false;
colors_display_1.ColorsDisplay.init(this.configuration);
this.displayProcessors = ExecutionDisplay.initProcessors(this.configuration);
this.hasCustomDisplaySpecStarted = ExecutionDisplay.hasCustomDisplaySpecStarted(this.displayProcessors);
}
ExecutionDisplay.initProcessors = function (configuration) {
var displayProcessors = [
new default_processor_1.DefaultProcessor(configuration),
new spec_prefixes_processor_1.SpecPrefixesProcessor(configuration),
new spec_colors_processor_1.SpecColorsProcessor(configuration),
...jasmineDone = function (runDetails) {
this.metrics.stop(runDetails);
this.summary.display(this.metrics);
}n/a
jasmineStarted = function (suiteInfo) {
this.metrics.start(suiteInfo);
this.display.jasmineStarted(suiteInfo);
}...
displayProcessors.push(new Processor(configuration));
});
}
return displayProcessors;
};
SpecReporter.prototype.jasmineStarted = function (suiteInfo) {
this.metrics.start(suiteInfo);
this.display.jasmineStarted(suiteInfo);
};
SpecReporter.prototype.jasmineDone = function (runDetails) {
this.metrics.stop(runDetails);
this.summary.display(this.metrics);
};
SpecReporter.prototype.suiteStarted = function (result) {
this.display.suiteStarted(result);
...specDone = function (result) {
this.metrics.stopSpec(result);
if (result.status === "pending") {
this.metrics.pendingSpecs++;
this.display.pending(result);
}
else if (result.status === "passed") {
this.metrics.successfulSpecs++;
this.display.successful(result);
}
else if (result.status === "failed") {
this.metrics.failedSpecs++;
this.display.failed(result);
}
}n/a
specStarted = function (result) {
this.metrics.startSpec();
this.display.specStarted(result);
}...
this.display.suiteStarted(result);
};
SpecReporter.prototype.suiteDone = function (result) {
this.display.suiteDone();
};
SpecReporter.prototype.specStarted = function (result) {
this.metrics.startSpec();
this.display.specStarted(result);
};
SpecReporter.prototype.specDone = function (result) {
this.metrics.stopSpec(result);
if (result.status === "pending") {
this.metrics.pendingSpecs++;
this.display.pending(result);
}
...suiteDone = function (result) {
this.display.suiteDone();
}...
this.metrics.stop(runDetails);
this.summary.display(this.metrics);
};
SpecReporter.prototype.suiteStarted = function (result) {
this.display.suiteStarted(result);
};
SpecReporter.prototype.suiteDone = function (result) {
this.display.suiteDone();
};
SpecReporter.prototype.specStarted = function (result) {
this.metrics.startSpec();
this.display.specStarted(result);
};
SpecReporter.prototype.specDone = function (result) {
this.metrics.stopSpec(result);
...suiteStarted = function (result) {
this.display.suiteStarted(result);
}...
this.display.jasmineStarted(suiteInfo);
};
SpecReporter.prototype.jasmineDone = function (runDetails) {
this.metrics.stop(runDetails);
this.summary.display(this.metrics);
};
SpecReporter.prototype.suiteStarted = function (result) {
this.display.suiteStarted(result);
};
SpecReporter.prototype.suiteDone = function (result) {
this.display.suiteDone();
};
SpecReporter.prototype.specStarted = function (result) {
this.metrics.startSpec();
this.display.specStarted(result);
...function ColorsDisplay() {
}n/a
function Configuration() {
}n/a
function ConfigurationParser() {
}n/a
function DefaultProcessor() {
return _super !== null && _super.apply(this, arguments) || this;
}...
this.lastWasNewLine = false;
colors_display_1.ColorsDisplay.init(this.configuration);
this.displayProcessors = ExecutionDisplay.initProcessors(this.configuration);
this.hasCustomDisplaySpecStarted = ExecutionDisplay.hasCustomDisplaySpecStarted(this.displayProcessors);
}
ExecutionDisplay.initProcessors = function (configuration) {
var displayProcessors = [
new default_processor_1.DefaultProcessor(configuration),
new spec_prefixes_processor_1.SpecPrefixesProcessor(configuration),
new spec_colors_processor_1.SpecColorsProcessor(configuration),
];
if (configuration.spec.displayDuration) {
displayProcessors.push(new spec_durations_processor_1.SpecDurationsProcessor(configuration));
}
if (configuration.suite.displayNumber) {
...function DisplayProcessor(configuration) {
this.configuration = configuration;
}n/a
function ExecutionDisplay(configuration) {
this.configuration = configuration;
this.indent = " ";
this.currentIndent = "";
this.suiteHierarchy = [];
this.suiteHierarchyDisplayed = [];
this.successfulSpecs = [];
this.failedSpecs = [];
this.pendingSpecs = [];
this.lastWasNewLine = false;
colors_display_1.ColorsDisplay.init(this.configuration);
this.displayProcessors = ExecutionDisplay.initProcessors(this.configuration);
this.hasCustomDisplaySpecStarted = ExecutionDisplay.hasCustomDisplaySpecStarted(this.displayProcessors);
}...
pending: [],
successful: []
};
this.configuration = configuration_parser_1.ConfigurationParser.parse(configuration);
var displayProcessors = SpecReporter.initProcessors(this.configuration);
var print = this.configuration.print;
this.logger = new logger_1.Logger(displayProcessors, print);
this.display = new execution_display_1.ExecutionDisplay(this.configuration, this.
logger, this.specs, displayProcessors);
this.summary = new summary_display_1.SummaryDisplay(this.logger, this.configuration, this.specs);
this.metrics = new execution_metrics_1.ExecutionMetrics();
}
SpecReporter.initProcessors = function (configuration) {
var displayProcessors = [
new default_processor_1.DefaultProcessor(configuration),
new spec_prefixes_processor_1.SpecPrefixesProcessor(configuration),
...function ExecutionMetrics() {
this.successfulSpecs = 0;
this.failedSpecs = 0;
this.pendingSpecs = 0;
this.skippedSpecs = 0;
this.totalSpecsDefined = 0;
this.executedSpecs = 0;
this.random = false;
}...
};
this.configuration = configuration_parser_1.ConfigurationParser.parse(configuration);
var displayProcessors = SpecReporter.initProcessors(this.configuration);
var print = this.configuration.print;
this.logger = new logger_1.Logger(displayProcessors, print);
this.display = new execution_display_1.ExecutionDisplay(this.configuration, this.logger, this.specs, displayProcessors);
this.summary = new summary_display_1.SummaryDisplay(this.logger, this.configuration, this.specs);
this.metrics = new execution_metrics_1.ExecutionMetrics();
}
SpecReporter.initProcessors = function (configuration) {
var displayProcessors = [
new default_processor_1.DefaultProcessor(configuration),
new spec_prefixes_processor_1.SpecPrefixesProcessor(configuration),
new spec_colors_processor_1.SpecColorsProcessor(configuration),
];
...function Logger(displayProcessors, print) {
this.displayProcessors = displayProcessors;
this.print = print;
this.indent = " ";
this.currentIndent = "";
this.lastWasNewLine = false;
}...
failed: [],
pending: [],
successful: []
};
this.configuration = configuration_parser_1.ConfigurationParser.parse(configuration);
var displayProcessors = SpecReporter.initProcessors(this.configuration);
var print = this.configuration.print;
this.logger = new logger_1.Logger(displayProcessors, print);
this.display = new execution_display_1.ExecutionDisplay(this.configuration, this.logger, this.specs, displayProcessors);
this.summary = new summary_display_1.SummaryDisplay(this.logger, this.configuration, this.specs);
this.metrics = new execution_metrics_1.ExecutionMetrics();
}
SpecReporter.initProcessors = function (configuration) {
var displayProcessors = [
new default_processor_1.DefaultProcessor(configuration),
...function SuiteNumberingProcessor() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.suiteHierarchy = [];
return _this;
}...
new spec_prefixes_processor_1.SpecPrefixesProcessor(configuration),
new spec_colors_processor_1.SpecColorsProcessor(configuration),
];
if (configuration.spec.displayDuration) {
displayProcessors.push(new spec_durations_processor_1.SpecDurationsProcessor(configuration));
}
if (configuration.suite.displayNumber) {
displayProcessors.push(new suite_numbering_processor_1.SuiteNumberingProcessor(configuration
));
}
if (configuration.customProcessors) {
configuration.customProcessors.forEach(function (Processor) {
displayProcessors.push(new Processor(configuration));
});
}
return displayProcessors;
...function SummaryDisplay(logger, configuration, specs) {
this.logger = logger;
this.configuration = configuration;
this.specs = specs;
}...
successful: []
};
this.configuration = configuration_parser_1.ConfigurationParser.parse(configuration);
var displayProcessors = SpecReporter.initProcessors(this.configuration);
var print = this.configuration.print;
this.logger = new logger_1.Logger(displayProcessors, print);
this.display = new execution_display_1.ExecutionDisplay(this.configuration, this.logger, this.specs, displayProcessors);
this.summary = new summary_display_1.SummaryDisplay(this.logger, this.configuration
, this.specs);
this.metrics = new execution_metrics_1.ExecutionMetrics();
}
SpecReporter.initProcessors = function (configuration) {
var displayProcessors = [
new default_processor_1.DefaultProcessor(configuration),
new spec_prefixes_processor_1.SpecPrefixesProcessor(configuration),
new spec_colors_processor_1.SpecColorsProcessor(configuration),
...