vendor/assets/libs/jasmine/jasmine-html.js in test_squad-0.0.1 vs vendor/assets/libs/jasmine/jasmine-html.js in test_squad-0.1.0

- old
+ new

@@ -1,7 +1,7 @@ /* -Copyright (c) 2008-2014 Pivotal Labs +Copyright (c) 2008-2015 Pivotal Labs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, @@ -38,10 +38,11 @@ var env = options.env || {}, getContainer = options.getContainer, createElement = options.createElement, createTextNode = options.createTextNode, onRaiseExceptionsClick = options.onRaiseExceptionsClick || function() {}, + addToExistingQueryString = options.addToExistingQueryString || defaultQueryString, timer = options.timer || noopTimer, results = [], specsExecuted = 0, failureCount = 0, pendingSpecCount = 0, @@ -218,10 +219,13 @@ } var specDescription = resultNode.result.description; if(noExpectations(resultNode.result)) { specDescription = 'SPEC HAS NO EXPECTATIONS ' + specDescription; } + if(resultNode.result.status === 'pending' && resultNode.result.pendingReason !== '') { + specDescription = specDescription + ' PENDING WITH MESSAGE: ' + resultNode.result.pendingReason; + } specListNode.appendChild( createDom('li', { className: resultNode.result.status, id: 'spec-' + resultNode.result.id }, @@ -265,11 +269,11 @@ } function clearPrior() { // return the reporter var oldReporter = find(''); - + if(oldReporter) { getContainer().removeChild(oldReporter); } } @@ -304,13 +308,17 @@ return '' + count + ' ' + word; } function specHref(result) { - return '?spec=' + encodeURIComponent(result.fullName); + return addToExistingQueryString('spec', result.fullName); } + function defaultQueryString(key, value) { + return '?' + key + '=' + value; + } + function setMenuModeTo(mode) { htmlReporterMain.setAttribute('class', 'jasmine_html-reporter ' + mode); } function noExpectations(result) { @@ -356,13 +364,17 @@ }; jasmineRequire.QueryString = function() { function QueryString(options) { - this.setParam = function(key, value) { + this.navigateWithNewParam = function(key, value) { + options.getWindowLocation().search = this.fullStringWithNewParam(key, value); + }; + + this.fullStringWithNewParam = function(key, value) { var paramMap = queryStringToParamMap(); paramMap[key] = value; - options.getWindowLocation().search = toQueryString(paramMap); + return toQueryString(paramMap); }; this.getParam = function(key) { return queryStringToParamMap()[key]; };