hifi-boot.js: Coding convention update

This commit is contained in:
Anthony J. Thibault 2016-04-18 09:49:09 -07:00
parent 9ab3255285
commit efb6a5c3f6

View file

@ -1,51 +1,53 @@
(function() { (function() {
function ConsoleReporter(options) { function ConsoleReporter(options) {
this.jasmineStarted = function (obj) { this.jasmineStarted = function (obj) {
print("jasmineStarted: numSpecs = " + obj.totalSpecsDefined); print("jasmineStarted: numSpecs = " + obj.totalSpecsDefined);
}; };
this.jasmineDone = function (obj) { this.jasmineDone = function (obj) {
print("jasmineDone"); print("jasmineDone");
}; };
this.suiteStarted = function(obj) { this.suiteStarted = function(obj) {
print("suiteStarted: \"" + obj.fullName + "\""); print("suiteStarted: \"" + obj.fullName + "\"");
}; };
this.suiteDone = function(obj) { this.suiteDone = function(obj) {
print("suiteDone: \"" + obj.fullName + "\" " + obj.status); print("suiteDone: \"" + obj.fullName + "\" " + obj.status);
}; };
this.specStarted = function(obj) { this.specStarted = function(obj) {
print("specStarted: \"" + obj.fullName + "\""); print("specStarted: \"" + obj.fullName + "\"");
}; };
this.specDone = function(obj) { this.specDone = function(obj) {
print("specDone: \"" + obj.fullName + "\" " + obj.status); print("specDone: \"" + obj.fullName + "\" " + obj.status);
var i, l = obj.failedExpectations.length; var i, l = obj.failedExpectations.length;
for (i = 0; i < l; i++) { for (i = 0; i < l; i++) {
print(" " + obj.failedExpectations[i].message); print(" " + obj.failedExpectations[i].message);
} }
}; };
return this; return this;
} }
setTimeout = Script.setTimeout; setTimeout = Script.setTimeout;
setInterval = Script.setInterval; setInterval = Script.setInterval;
clearTimeout = Script.clearTimeout; clearTimeout = Script.clearTimeout;
clearInterval = Script.clearInterval; clearInterval = Script.clearInterval;
var jasmine = jasmineRequire.core(jasmineRequire); var jasmine = jasmineRequire.core(jasmineRequire);
var env = jasmine.getEnv(); var env = jasmine.getEnv();
env.addReporter(new ConsoleReporter()); env.addReporter(new ConsoleReporter());
var jasmineInterface = jasmineRequire.interface(jasmine, env); var jasmineInterface = jasmineRequire.interface(jasmine, env);
extend(this, jasmineInterface); extend(this, jasmineInterface);
function extend(destination, source) { function extend(destination, source) {
for (var property in source) destination[property] = source[property]; for (var property in source) {
return destination; destination[property] = source[property];
} }
return destination;
}
}()); }());