Fixed linter & formatter issues in boot files

This commit is contained in:
Steve Gravrock
2021-09-03 15:46:23 -07:00
parent 6603ed7ddc
commit bbcb5ff42f
6 changed files with 68 additions and 54 deletions

View File

@@ -61,4 +61,4 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
for (var property in jasmineInterface) { for (var property in jasmineInterface) {
global[property] = jasmineInterface[property]; global[property] = jasmineInterface[property];
} }
}()); })();

View File

@@ -21,7 +21,7 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
/** /**
This file finishes "booting" Jasmine, performing all of the necessary This file finishes 'booting' Jasmine, performing all of the necessary
initialization before executing the loaded environment and all of a project's initialization before executing the loaded environment and all of a project's
specs. This file should be loaded after `boot0.js` but before any project specs. This file should be loaded after `boot0.js` but before any project
source files or spec files are loaded. Thus this file can also be used to source files or spec files are loaded. Thus this file can also be used to
@@ -43,24 +43,28 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
var queryString = new jasmine.QueryString({ var queryString = new jasmine.QueryString({
getWindowLocation: function() { return window.location; } getWindowLocation: function() {
return window.location;
}
}); });
var filterSpecs = !!queryString.getParam("spec"); var filterSpecs = !!queryString.getParam('spec');
var config = { var config = {
stopOnSpecFailure: queryString.getParam("stopOnSpecFailure"), stopOnSpecFailure: queryString.getParam('stopOnSpecFailure'),
stopSpecOnExpectationFailure: queryString.getParam("stopSpecOnExpectationFailure"), stopSpecOnExpectationFailure: queryString.getParam(
hideDisabled: queryString.getParam("hideDisabled") 'stopSpecOnExpectationFailure'
),
hideDisabled: queryString.getParam('hideDisabled')
}; };
var random = queryString.getParam("random"); var random = queryString.getParam('random');
if (random !== undefined && random !== "") { if (random !== undefined && random !== '') {
config.random = random; config.random = random;
} }
var seed = queryString.getParam("seed"); var seed = queryString.getParam('seed');
if (seed) { if (seed) {
config.seed = seed; config.seed = seed;
} }
@@ -71,11 +75,21 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
var htmlReporter = new jasmine.HtmlReporter({ var htmlReporter = new jasmine.HtmlReporter({
env: env, env: env,
navigateWithNewParam: function(key, value) { return queryString.navigateWithNewParam(key, value); }, navigateWithNewParam: function(key, value) {
addToExistingQueryString: function(key, value) { return queryString.fullStringWithNewParam(key, value); }, return queryString.navigateWithNewParam(key, value);
getContainer: function() { return document.body; }, },
createElement: function() { return document.createElement.apply(document, arguments); }, addToExistingQueryString: function(key, value) {
createTextNode: function() { return document.createTextNode.apply(document, arguments); }, return queryString.fullStringWithNewParam(key, value);
},
getContainer: function() {
return document.body;
},
createElement: function() {
return document.createElement.apply(document, arguments);
},
createTextNode: function() {
return document.createTextNode.apply(document, arguments);
},
timer: new jasmine.Timer(), timer: new jasmine.Timer(),
filterSpecs: filterSpecs filterSpecs: filterSpecs
}); });
@@ -90,7 +104,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Filter which specs will be run by matching the start of the full name against the `spec` query param. * Filter which specs will be run by matching the start of the full name against the `spec` query param.
*/ */
var specFilter = new jasmine.HtmlSpecFilter({ var specFilter = new jasmine.HtmlSpecFilter({
filterString: function() { return queryString.getParam("spec"); } filterString: function() {
return queryString.getParam('spec');
}
}); });
config.specFilter = function(spec) { config.specFilter = function(spec) {
@@ -113,13 +129,4 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
htmlReporter.initialize(); htmlReporter.initialize();
env.execute(); env.execute();
}; };
})();
/**
* Helper function for readability above.
*/
function extend(destination, source) {
for (var property in source) destination[property] = source[property];
return destination;
}
}());

View File

@@ -23,7 +23,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
module.exports = function(jasmineRequire) { module.exports = function(jasmineRequire) {
var jasmine = jasmineRequire.core(jasmineRequire); var jasmine = jasmineRequire.core(jasmineRequire);
var env = jasmine.getEnv({suppressLoadErrors: true}); var env = jasmine.getEnv({ suppressLoadErrors: true });
var jasmineInterface = jasmineRequire.interface(jasmine, env); var jasmineInterface = jasmineRequire.interface(jasmine, env);

View File

@@ -39,4 +39,4 @@
for (var property in jasmineInterface) { for (var property in jasmineInterface) {
global[property] = jasmineInterface[property]; global[property] = jasmineInterface[property];
} }
}()); })();

View File

@@ -1,5 +1,5 @@
/** /**
This file finishes "booting" Jasmine, performing all of the necessary This file finishes 'booting' Jasmine, performing all of the necessary
initialization before executing the loaded environment and all of a project's initialization before executing the loaded environment and all of a project's
specs. This file should be loaded after `boot0.js` but before any project specs. This file should be loaded after `boot0.js` but before any project
source files or spec files are loaded. Thus this file can also be used to source files or spec files are loaded. Thus this file can also be used to
@@ -21,24 +21,28 @@
*/ */
var queryString = new jasmine.QueryString({ var queryString = new jasmine.QueryString({
getWindowLocation: function() { return window.location; } getWindowLocation: function() {
return window.location;
}
}); });
var filterSpecs = !!queryString.getParam("spec"); var filterSpecs = !!queryString.getParam('spec');
var config = { var config = {
stopOnSpecFailure: queryString.getParam("stopOnSpecFailure"), stopOnSpecFailure: queryString.getParam('stopOnSpecFailure'),
stopSpecOnExpectationFailure: queryString.getParam("stopSpecOnExpectationFailure"), stopSpecOnExpectationFailure: queryString.getParam(
hideDisabled: queryString.getParam("hideDisabled") 'stopSpecOnExpectationFailure'
),
hideDisabled: queryString.getParam('hideDisabled')
}; };
var random = queryString.getParam("random"); var random = queryString.getParam('random');
if (random !== undefined && random !== "") { if (random !== undefined && random !== '') {
config.random = random; config.random = random;
} }
var seed = queryString.getParam("seed"); var seed = queryString.getParam('seed');
if (seed) { if (seed) {
config.seed = seed; config.seed = seed;
} }
@@ -49,11 +53,21 @@
*/ */
var htmlReporter = new jasmine.HtmlReporter({ var htmlReporter = new jasmine.HtmlReporter({
env: env, env: env,
navigateWithNewParam: function(key, value) { return queryString.navigateWithNewParam(key, value); }, navigateWithNewParam: function(key, value) {
addToExistingQueryString: function(key, value) { return queryString.fullStringWithNewParam(key, value); }, return queryString.navigateWithNewParam(key, value);
getContainer: function() { return document.body; }, },
createElement: function() { return document.createElement.apply(document, arguments); }, addToExistingQueryString: function(key, value) {
createTextNode: function() { return document.createTextNode.apply(document, arguments); }, return queryString.fullStringWithNewParam(key, value);
},
getContainer: function() {
return document.body;
},
createElement: function() {
return document.createElement.apply(document, arguments);
},
createTextNode: function() {
return document.createTextNode.apply(document, arguments);
},
timer: new jasmine.Timer(), timer: new jasmine.Timer(),
filterSpecs: filterSpecs filterSpecs: filterSpecs
}); });
@@ -68,7 +82,9 @@
* Filter which specs will be run by matching the start of the full name against the `spec` query param. * Filter which specs will be run by matching the start of the full name against the `spec` query param.
*/ */
var specFilter = new jasmine.HtmlSpecFilter({ var specFilter = new jasmine.HtmlSpecFilter({
filterString: function() { return queryString.getParam("spec"); } filterString: function() {
return queryString.getParam('spec');
}
}); });
config.specFilter = function(spec) { config.specFilter = function(spec) {
@@ -91,13 +107,4 @@
htmlReporter.initialize(); htmlReporter.initialize();
env.execute(); env.execute();
}; };
})();
/**
* Helper function for readability above.
*/
function extend(destination, source) {
for (var property in source) destination[property] = source[property];
return destination;
}
}());

View File

@@ -1,7 +1,7 @@
module.exports = function(jasmineRequire) { module.exports = function(jasmineRequire) {
var jasmine = jasmineRequire.core(jasmineRequire); var jasmine = jasmineRequire.core(jasmineRequire);
var env = jasmine.getEnv({suppressLoadErrors: true}); var env = jasmine.getEnv({ suppressLoadErrors: true });
var jasmineInterface = jasmineRequire.interface(jasmine, env); var jasmineInterface = jasmineRequire.interface(jasmine, env);