diff --git a/spec/core/DelayedFunctionSchedulerSpec.js b/spec/core/DelayedFunctionSchedulerSpec.js index 6d0698f5..7048b9e8 100644 --- a/spec/core/DelayedFunctionSchedulerSpec.js +++ b/spec/core/DelayedFunctionSchedulerSpec.js @@ -14,7 +14,7 @@ describe("DelayedFunctionScheduler", function() { it("schedules a string for later execution", function() { var scheduler = new j$.DelayedFunctionScheduler(), - strfn = "horrible = true;"; + strfn = "horrible = true;"; scheduler.scheduleFunction(strfn, 0); diff --git a/spec/core/EnvSpec.js b/spec/core/EnvSpec.js index 31389f09..86898f56 100644 --- a/spec/core/EnvSpec.js +++ b/spec/core/EnvSpec.js @@ -6,20 +6,20 @@ describe("Env", function() { }); it('removes all spies when env is executed', function(done) { - originalFoo = function() {}, - testObj = { - foo: originalFoo - }, - firstSpec = jasmine.createSpy('firstSpec').and.callFake(function() { - env.spyOn(testObj, 'foo'); - }), - secondSpec = jasmine.createSpy('secondSpec').and.callFake(function() { - expect(testObj.foo).toBe(originalFoo); - }); - env.describe('test suite', function() { - env.it('spec 0', firstSpec); - env.it('spec 1', secondSpec); - }); + var originalFoo = function() {}, + testObj = { + foo: originalFoo + }, + firstSpec = jasmine.createSpy('firstSpec').and.callFake(function() { + env.spyOn(testObj, 'foo'); + }), + secondSpec = jasmine.createSpy('secondSpec').and.callFake(function() { + expect(testObj.foo).toBe(originalFoo); + }); + env.describe('test suite', function() { + env.it('spec 0', firstSpec); + env.it('spec 1', secondSpec); + }); var assertions = function() { expect(firstSpec).toHaveBeenCalled(); diff --git a/spec/core/ExceptionsSpec.js b/spec/core/ExceptionsSpec.js index f50f3c76..954f834e 100644 --- a/spec/core/ExceptionsSpec.js +++ b/spec/core/ExceptionsSpec.js @@ -35,7 +35,7 @@ describe('Exceptions:', function() { env.it('should be a passing test that runs after exceptions are thrown from a async test', secondTest); }); - expectations = function() { + var expectations = function() { expect(secondTest).toHaveBeenCalled(); done(); }; @@ -55,7 +55,7 @@ describe('Exceptions:', function() { }); env.describe("a suite that doesn't throw an exception", secondDescribe); - expectations = function() { + var expectations = function() { expect(secondDescribe).toHaveBeenCalled(); done(); }; diff --git a/spec/core/QueueRunnerSpec.js b/spec/core/QueueRunnerSpec.js index 71a0f1cb..f4122b6a 100644 --- a/spec/core/QueueRunnerSpec.js +++ b/spec/core/QueueRunnerSpec.js @@ -50,31 +50,31 @@ describe("QueueRunner", function() { //createSpy('asyncfn').and.callFake(function(done) {}); var onComplete = jasmine.createSpy('onComplete'), - beforeCallback = jasmine.createSpy('beforeCallback'), - fnCallback = jasmine.createSpy('fnCallback'), - afterCallback = jasmine.createSpy('afterCallback'), - fn1 = function(done) { - beforeCallback(); - setTimeout(function() { - done() - }, 100); - }, - fn2 = function(done) { - fnCallback(); - setTimeout(function() { - done() - }, 100); - }, - fn3 = function(done) { - afterCallback(); - setTimeout(function() { - done() - }, 100); - }, - queueRunner = new j$.QueueRunner({ - fns: [fn1, fn2, fn3], - onComplete: onComplete - }); + beforeCallback = jasmine.createSpy('beforeCallback'), + fnCallback = jasmine.createSpy('fnCallback'), + afterCallback = jasmine.createSpy('afterCallback'), + fn1 = function(done) { + beforeCallback(); + setTimeout(function() { + done() + }, 100); + }, + fn2 = function(done) { + fnCallback(); + setTimeout(function() { + done() + }, 100); + }, + fn3 = function(done) { + afterCallback(); + setTimeout(function() { + done() + }, 100); + }, + queueRunner = new j$.QueueRunner({ + fns: [fn1, fn2, fn3], + onComplete: onComplete + }); queueRunner.execute(); @@ -129,11 +129,10 @@ describe("QueueRunner", function() { it("continues running the functions even after an exception is thrown in an async spec", function() { var fn = function(done) { throw new Error("error"); }, - nextFn = jasmine.createSpy("nextFunction"); - - queueRunner = new j$.QueueRunner({ - fns: [fn, nextFn] - }); + nextFn = jasmine.createSpy("nextFunction"), + queueRunner = new j$.QueueRunner({ + fns: [fn, nextFn] + }); queueRunner.execute(); expect(nextFn).toHaveBeenCalled(); diff --git a/spec/core/matchers/toBeGreaterThanSpec.js b/spec/core/matchers/toBeGreaterThanSpec.js index 397c0e55..c530dcfd 100644 --- a/spec/core/matchers/toBeGreaterThanSpec.js +++ b/spec/core/matchers/toBeGreaterThanSpec.js @@ -8,7 +8,8 @@ describe("toBeGreaterThan", function() { }); it("fails when actual <= expected", function() { - var matcher = j$.matchers.toBeGreaterThan(); + var matcher = j$.matchers.toBeGreaterThan(), + result; result = matcher.compare(1, 1); expect(result.pass).toBe(false); diff --git a/spec/core/matchers/toBeNaNSpec.js b/spec/core/matchers/toBeNaNSpec.js index d4a00b4d..c0cbcc5d 100644 --- a/spec/core/matchers/toBeNaNSpec.js +++ b/spec/core/matchers/toBeNaNSpec.js @@ -9,7 +9,8 @@ describe("toBeNaN", function() { }); it("fails for anything not a NaN", function() { - var matcher = j$.matchers.toBeNaN(); + var matcher = j$.matchers.toBeNaN(), + result; result = matcher.compare(1); expect(result.pass).toBe(false); diff --git a/spec/core/matchers/toBeUndefinedSpec.js b/spec/core/matchers/toBeUndefinedSpec.js index 9d166276..eefe7451 100644 --- a/spec/core/matchers/toBeUndefinedSpec.js +++ b/spec/core/matchers/toBeUndefinedSpec.js @@ -9,7 +9,8 @@ describe("toBeUndefined", function() { }); it("fails when matching defined values", function() { - var matcher = j$.matchers.toBeUndefined(); + var matcher = j$.matchers.toBeUndefined(), + result; result = matcher.compare('foo'); expect(result.pass).toBe(false); diff --git a/spec/core/matchers/toContainSpec.js b/spec/core/matchers/toContainSpec.js index 848a73dc..1025dffb 100644 --- a/spec/core/matchers/toContainSpec.js +++ b/spec/core/matchers/toContainSpec.js @@ -3,7 +3,8 @@ describe("toContain", function() { var util = { contains: jasmine.createSpy('delegated-contains').and.returnValue(true) }, - matcher = j$.matchers.toContain(util); + matcher = j$.matchers.toContain(util), + result; result = matcher.compare("ABC", "B"); expect(util.contains).toHaveBeenCalledWith("ABC", "B", []); @@ -15,7 +16,8 @@ describe("toContain", function() { contains: jasmine.createSpy('delegated-contains').and.returnValue(true) }, customEqualityTesters = ['a', 'b'], - matcher = j$.matchers.toContain(util, customEqualityTesters); + matcher = j$.matchers.toContain(util, customEqualityTesters), + result; result = matcher.compare("ABC", "B"); expect(util.contains).toHaveBeenCalledWith("ABC", "B", ['a', 'b']); diff --git a/spec/core/matchers/toHaveBeenCalledSpec.js b/spec/core/matchers/toHaveBeenCalledSpec.js index 88c8d4a7..82d17e99 100644 --- a/spec/core/matchers/toHaveBeenCalledSpec.js +++ b/spec/core/matchers/toHaveBeenCalledSpec.js @@ -13,7 +13,8 @@ describe("toHaveBeenCalled", function() { it("fails when the actual was not called", function() { var matcher = j$.matchers.toHaveBeenCalled(), - uncalledSpy = j$.createSpy('uncalled spy'); + uncalledSpy = j$.createSpy('uncalled spy'), + result; result = matcher.compare(uncalledSpy); expect(result.pass).toBe(false); diff --git a/spec/html/HtmlReporterSpec.js b/spec/html/HtmlReporterSpec.js index 814c0c49..052e33cf 100644 --- a/spec/html/HtmlReporterSpec.js +++ b/spec/html/HtmlReporterSpec.js @@ -326,7 +326,7 @@ describe("New HtmlReporter", function() { beforeEach(function() { env = new j$.Env(); container = document.createElement("div"); - getContainer = function() { return container; }, + var getContainer = function() { return container; }, reporter = new j$.HtmlReporter({ env: env, getContainer: getContainer, @@ -377,13 +377,13 @@ describe("New HtmlReporter", function() { beforeEach(function() { env = new j$.Env(); container = document.createElement("div"); - getContainer = function() { return container; }, - reporter = new j$.HtmlReporter({ - env: env, - getContainer: getContainer, - createElement: function() { return document.createElement.apply(document, arguments); }, - createTextNode: function() { return document.createTextNode.apply(document, arguments); } - }); + var getContainer = function() { return container; }; + reporter = new j$.HtmlReporter({ + env: env, + getContainer: getContainer, + createElement: function() { return document.createElement.apply(document, arguments); }, + createTextNode: function() { return document.createTextNode.apply(document, arguments); } + }); reporter.initialize(); reporter.jasmineStarted({}); @@ -414,14 +414,14 @@ describe("New HtmlReporter", function() { beforeEach(function() { env = new j$.Env(); - container = document.createElement("div"), - getContainer = function() { return container; }, - reporter = new j$.HtmlReporter({ - env: env, - getContainer: getContainer, - createElement: function() { return document.createElement.apply(document, arguments); }, - createTextNode: function() { return document.createTextNode.apply(document, arguments); } - }); + container = document.createElement("div"); + var getContainer = function() { return container; } + reporter = new j$.HtmlReporter({ + env: env, + getContainer: getContainer, + createElement: function() { return document.createElement.apply(document, arguments); }, + createTextNode: function() { return document.createTextNode.apply(document, arguments); } + }); reporter.initialize(); reporter.jasmineStarted({});