diff --git a/app/scripts/views/sign_in.js b/app/scripts/views/sign_in.js index 9a5e7e810..b3eb628a6 100644 --- a/app/scripts/views/sign_in.js +++ b/app/scripts/views/sign_in.js @@ -23,7 +23,9 @@ function(BaseView, SignInTemplate, gherkin, Session, Constants) { signIn: function(event) { event.preventDefault(); - if (! (this._validateEmail() && this._validatePassword())) return; + if (! (this._validateEmail() && this._validatePassword())) { + return; + } var email = this.$('.email').val(); var password = this.$('.password').val(); diff --git a/app/scripts/views/sign_up.js b/app/scripts/views/sign_up.js index 4c8a51369..b54a3496a 100644 --- a/app/scripts/views/sign_up.js +++ b/app/scripts/views/sign_up.js @@ -23,7 +23,9 @@ function(BaseView, SignUpTemplate, gherkin, Session, Constants) { signUp: function(event) { event.preventDefault(); - if (! (this._validateEmail() && this._validatePassword())) return; + if (! (this._validateEmail() && this._validatePassword())) { + return; + } var email = this.$('.email').val(); var password = this.$('.password').val(); diff --git a/tests/functional.js b/tests/functional.js index 3c36ada9f..f04cfd2e2 100644 --- a/tests/functional.js +++ b/tests/functional.js @@ -5,4 +5,6 @@ define([ './functional/login', './functional/create_account' -], function () {}); +], function () { + 'use strict'; +}); diff --git a/tests/functional/create_account.js b/tests/functional/create_account.js index 1c888890b..b510f7a83 100644 --- a/tests/functional/create_account.js +++ b/tests/functional/create_account.js @@ -7,6 +7,8 @@ define([ 'intern/chai!assert', 'require' ], function (registerSuite, assert, require) { + 'use strict'; + var url = 'http://localhost:3030/flow'; //var email = 'some' + new Date().getTime() + '@example.com'; @@ -47,7 +49,7 @@ define([ .then(function (resultText) { assert.strictEqual(resultText, '', 'No errors in email creation'); }) - .end() + .end(); } }); -}); \ No newline at end of file +}); diff --git a/tests/functional/login.js b/tests/functional/login.js index 5cc3d6097..08a6c8390 100644 --- a/tests/functional/login.js +++ b/tests/functional/login.js @@ -7,6 +7,8 @@ define([ 'intern/chai!assert', 'require' ], function (registerSuite, assert, require) { + 'use strict'; + var url = 'http://localhost:3030/flow'; registerSuite({ @@ -47,7 +49,7 @@ define([ .then(function (text) { assert.strictEqual(text, 'Try another email or Create an account', 'Validates false login'); }) - .end() + .end(); } }); }); \ No newline at end of file diff --git a/tests/intern_functional.js b/tests/intern_functional.js index f5b730585..1b1e991cb 100644 --- a/tests/intern_functional.js +++ b/tests/intern_functional.js @@ -5,6 +5,7 @@ define([ './intern' ], function (intern) { + 'use strict'; intern.suites = []; intern.functionalSuites = [ 'tests/functional' ]; diff --git a/tests/intern_remote.js b/tests/intern_remote.js index ad3626e40..600bbf874 100644 --- a/tests/intern_remote.js +++ b/tests/intern_remote.js @@ -5,6 +5,8 @@ define([ './intern' ], function (intern) { + 'use strict'; + // simply override the main config file and adjust it to suite the local env // disable Sauce Connect for local config diff --git a/tests/tdd/assertion_service.js b/tests/tdd/assertion_service.js index 61a5e0337..bf3759d7f 100644 --- a/tests/tdd/assertion_service.js +++ b/tests/tdd/assertion_service.js @@ -11,7 +11,6 @@ define([ 'intern/order!static/javascripts/vendor/bidbundle.js', 'intern/order!static/javascripts/assertion_service.js' ], function (tdd, assert, Deferred, request) { - with (tdd) { suite('assertion_service', function () { var client; @@ -34,7 +33,7 @@ define([ return client.login(); }) - .done(function (x) { + .done(function () { setupDfd.resolve(); }); @@ -102,7 +101,7 @@ define([ request .get(serverUrl + '/.well-known/browserid', { headers: { - "X-Requested-With": '' + 'X-Requested-With': '' } }) .then( @@ -132,18 +131,21 @@ define([ assert.ok(components.payload.iat, 'Issued date exists'); assert.ok(components.payload.exp, 'Expire date exists'); - if (typeof components.payload.iat !== 'number') + if (typeof components.payload.iat !== 'number') { dfd.reject(new assert.AssertionError({ message: 'cert lacks an "issued at" (.iat) field' })); + } - if (typeof components.payload.exp !== 'number') + if (typeof components.payload.exp !== 'number') { dfd.reject(new assert.AssertionError({ message: 'cert lacks an "expires" (.exp) field' })); + } - if (components.payload.exp < components.payload.iat) + if (components.payload.exp < components.payload.iat) { dfd.reject(new assert.AssertionError({ message: 'assertion expires before cert is valid' })); + } - if (components.payload.exp > (components.payload.exp + 5000)) + if (components.payload.exp > (components.payload.exp + 5000)) { dfd.reject(new assert.AssertionError({ message: 'assertion was likely issued after cert expired' })); - + } return { assertion: assertion, @@ -156,7 +158,7 @@ define([ }, function (err) { dfd.reject(); - assert.fail(err, null, '.well-known request failed') + assert.fail(err, null, '.well-known request failed'); } ) .then( @@ -181,7 +183,7 @@ define([ } ); - return verifyDeferred.promise + return verifyDeferred.promise; } ) .then( @@ -209,7 +211,7 @@ define([ } }); - return verifyBundleDeferred.promise + return verifyBundleDeferred.promise; } ).otherwise(function (error) { dfd.reject(error); });