Moved dependencies out of HtmlReporter and into boot.js - QueryString for spec filtering and UI around raising exceptions checkbox; New object for handling spec filtering for browsers;

This commit is contained in:
Dan Hansen and Davis W. Frank
2013-02-19 15:29:50 -08:00
parent c53b36a9b2
commit 10b09ea9f5
7 changed files with 71 additions and 214 deletions

View File

@@ -5,7 +5,6 @@ jasmine.HtmlReporter = function(options) {
createElement = options.createElement,
createTextNode = options.createTextNode,
results = [],
queryString = options.queryString,
startTime,
specsExecuted = 0,
failureCount = 0,
@@ -29,18 +28,6 @@ jasmine.HtmlReporter = function(options) {
symbols = find(".symbol-summary")[0];
};
var specFilterPattern;
this.specFilter = function(spec) {
if (!isFiltered()) {
return true;
}
var specName = spec.getFullName();
return !!(specName.match(specFilterPattern));
};
var totalSpecsDefined;
this.jasmineStarted = function(options) {
totalSpecsDefined = options.totalSpecsDefined || 0;
@@ -120,9 +107,7 @@ jasmine.HtmlReporter = function(options) {
var checkbox = find("input")[0];
checkbox.checked = !env.catchingExceptions();
checkbox.onclick = function() {
queryString.setParam("catch", !checkbox.checked);
};
checkbox.onclick = options.onRaiseExceptionsClick;
if (specsExecuted < totalSpecsDefined) {
var skippedMessage = "Ran " + specsExecuted + " of " + totalSpecsDefined + " specs - run all";
@@ -245,18 +230,6 @@ jasmine.HtmlReporter = function(options) {
return "?spec=" + encodeURIComponent(result.fullName);
}
function isFiltered() {
buildSpecFilter();
return !!specFilterPattern;
}
function buildSpecFilter() {
var specFilterParam = queryString.getParam("spec") || "";
specFilterPattern = new RegExp(specFilterParam);
}
function setMenuModeTo(mode) {
htmlReporterMain.setAttribute("class", "html-reporter " + mode);
}