From 76c3cfd21a167df2f2e8489e7606f0033f63a0ea Mon Sep 17 00:00:00 2001 From: Arthur Cinader Date: Thu, 1 Dec 2016 17:16:44 -0800 Subject: [PATCH] Add strip whitespace and trailing eol to spec too. --- spec/.eslintrc.json | 6 ++++-- spec/AccountLockoutPolicy.spec.js | 4 ++-- spec/Analytics.spec.js | 10 +++++----- spec/ClientSDK.spec.js | 6 +++--- spec/HTTPRequest.spec.js | 2 +- spec/Middlewares.spec.js | 2 +- spec/MongoStorageAdapter.spec.js | 4 ++-- spec/MongoTransform.spec.js | 4 ++-- spec/ParseInstallation.spec.js | 6 +++--- spec/ParseLiveQueryServer.spec.js | 2 +- spec/ParseServerRESTController.spec.js | 2 +- spec/ParseUser.spec.js | 6 +++--- spec/RestQuery.spec.js | 2 +- spec/RevocableSessionsUpgrade.spec.js | 2 +- spec/Schema.spec.js | 2 +- spec/TwitterAuth.spec.js | 8 ++++---- spec/helper.js | 2 +- spec/parsers.spec.js | 2 +- spec/rest.spec.js | 2 +- 19 files changed, 38 insertions(+), 36 deletions(-) diff --git a/spec/.eslintrc.json b/spec/.eslintrc.json index 5eda075f23..288ac65efd 100644 --- a/spec/.eslintrc.json +++ b/spec/.eslintrc.json @@ -30,6 +30,8 @@ }, "rules": { "no-console": [0], - "indent": ["error", 2] + "indent": ["error", 2], + "no-trailing-spaces": 2, + "eol-last": 2 } -} \ No newline at end of file +} diff --git a/spec/AccountLockoutPolicy.spec.js b/spec/AccountLockoutPolicy.spec.js index 13e4b94e93..eb01375dde 100644 --- a/spec/AccountLockoutPolicy.spec.js +++ b/spec/AccountLockoutPolicy.spec.js @@ -263,7 +263,7 @@ describe("Account Lockout Policy: ", () => { return isAccountLockoutError('username3', 'wrong password', 0.05, 1); }) .then(() => { - // account should still be locked even after 2 seconds. + // account should still be locked even after 2 seconds. return isAccountLockoutError('username3', 'wrong password', 0.05, 2000); }) .then(() => { @@ -297,7 +297,7 @@ describe("Account Lockout Policy: ", () => { return loginWithWrongCredentialsShouldFail('username4', 'wrong password'); }) .then(() => { - // allow locked user to login after 3 seconds with a valid userid and password + // allow locked user to login after 3 seconds with a valid userid and password return new Promise((resolve, reject) => { setTimeout(() => { Parse.User.logIn('username4', 'correct password') diff --git a/spec/Analytics.spec.js b/spec/Analytics.spec.js index e2f07ee9c1..4980826d09 100644 --- a/spec/Analytics.spec.js +++ b/spec/Analytics.spec.js @@ -1,11 +1,11 @@ const analyticsAdapter = { - appOpened: function() {}, + appOpened: function() {}, trackEvent: function() {} } describe('AnalyticsController', () => { it('should track a simple event', (done) => { - + spyOn(analyticsAdapter, 'trackEvent').and.callThrough(); reconfigureServer({ analyticsAdapter @@ -31,9 +31,9 @@ describe('AnalyticsController', () => { done(); }) }); - + it('should track a app opened event', (done) => { - + spyOn(analyticsAdapter, 'appOpened').and.callThrough(); reconfigureServer({ analyticsAdapter @@ -58,4 +58,4 @@ describe('AnalyticsController', () => { done(); }) }) -}) \ No newline at end of file +}) diff --git a/spec/ClientSDK.spec.js b/spec/ClientSDK.spec.js index d234a01d3d..92e07a8dc0 100644 --- a/spec/ClientSDK.spec.js +++ b/spec/ClientSDK.spec.js @@ -20,12 +20,12 @@ describe('ClientSDK', () => { version: '1.9.0' }); }); - + it('should properly sastisfy', () => { expect(ClientSDK.compatible({ js: '>=1.9.0' })("js1.9.0")).toBe(true); - + expect(ClientSDK.compatible({ js: '>=1.9.0' })("js2.0.0")).toBe(true); @@ -38,4 +38,4 @@ describe('ClientSDK', () => { js: '>=1.9.0' })(undefined)).toBe(true); }) -}) \ No newline at end of file +}) diff --git a/spec/HTTPRequest.spec.js b/spec/HTTPRequest.spec.js index 3e281e6786..e9a2506a9a 100644 --- a/spec/HTTPRequest.spec.js +++ b/spec/HTTPRequest.spec.js @@ -272,7 +272,7 @@ describe("httpRequest", () => { Parse._encode(httpResponse); let serialized = JSON.stringify(httpResponse); let result = JSON.parse(serialized); - + expect(httpResponse.text).toEqual('{"foo":"bar"}'); expect(httpResponse.data).toEqual({foo: 'bar'}); expect(httpResponse.body).toEqual({foo: 'bar'}); diff --git a/spec/Middlewares.spec.js b/spec/Middlewares.spec.js index de84605c07..00dc63c59c 100644 --- a/spec/Middlewares.spec.js +++ b/spec/Middlewares.spec.js @@ -120,4 +120,4 @@ describe('middlewares', () => { }); }); }); -}); \ No newline at end of file +}); diff --git a/spec/MongoStorageAdapter.spec.js b/spec/MongoStorageAdapter.spec.js index 922832cc77..86d15e2686 100644 --- a/spec/MongoStorageAdapter.spec.js +++ b/spec/MongoStorageAdapter.spec.js @@ -192,14 +192,14 @@ describe_only_db('mongo')('MongoStorageAdapter', () => { it("handles updating a single object with array, object date", (done) => { let adapter = new MongoStorageAdapter({ uri: databaseURI }); - + let schema = { fields: { array: { type: 'Array' }, object: { type: 'Object' }, date: { type: 'Date' }, } }; - + adapter.createObject('MyClass', schema, {}) .then(() => adapter._rawFind('MyClass', {})) .then(results => { diff --git a/spec/MongoTransform.spec.js b/spec/MongoTransform.spec.js index 2bcf14c7b9..00a8ba31dd 100644 --- a/spec/MongoTransform.spec.js +++ b/spec/MongoTransform.spec.js @@ -242,7 +242,7 @@ describe('parseObjectToMongoObjectForCreate', () => { }; var output = transform.parseObjectToMongoObjectForCreate(null, input, { fields: { - aRelation: { __type: 'Relation', className: 'Stuff' }, + aRelation: { __type: 'Relation', className: 'Stuff' }, }, }); expect(output).toEqual({}); @@ -302,7 +302,7 @@ describe('transformUpdate', () => { }; var output = transform.transformUpdate(null, input, { fields: { - aRelation: { __type: 'Relation', className: 'Stuff' }, + aRelation: { __type: 'Relation', className: 'Stuff' }, }, }); expect(output).toEqual({}); diff --git a/spec/ParseInstallation.spec.js b/spec/ParseInstallation.spec.js index 60940f7fac..fd3fb55a8c 100644 --- a/spec/ParseInstallation.spec.js +++ b/spec/ParseInstallation.spec.js @@ -288,9 +288,9 @@ describe('Installations', () => { expect(results.length).toEqual(1); expect(results[0]['_id']).toEqual(secondObject._id); done(); - }).catch((error) => { - jfail(error); - done(); + }).catch((error) => { + jfail(error); + done(); }); }); diff --git a/spec/ParseLiveQueryServer.spec.js b/spec/ParseLiveQueryServer.spec.js index 668f7f8a19..50a4133a2d 100644 --- a/spec/ParseLiveQueryServer.spec.js +++ b/spec/ParseLiveQueryServer.spec.js @@ -928,7 +928,7 @@ describe('ParseLiveQueryServer', function() { } } }); - + parseLiveQueryServer._matchesACL(acl, client, requestId).then(function(isMatched) { expect(isMatched).toBe(false); done(); diff --git a/spec/ParseServerRESTController.spec.js b/spec/ParseServerRESTController.spec.js index 1bf997b8fe..6d19636e75 100644 --- a/spec/ParseServerRESTController.spec.js +++ b/spec/ParseServerRESTController.spec.js @@ -115,4 +115,4 @@ describe('ParseServerRESTController', () => { done(); }); }); -}); \ No newline at end of file +}); diff --git a/spec/ParseUser.spec.js b/spec/ParseUser.spec.js index d6edf31e64..bd301a3aca 100644 --- a/spec/ParseUser.spec.js +++ b/spec/ParseUser.spec.js @@ -2385,7 +2385,7 @@ describe('Parse.User testing', () => { req.object.set('foo', 'bar'); res.success(); }); - + let originalSessionToken; let originalUserId; // Simulate anonymous user save @@ -2463,7 +2463,7 @@ describe('Parse.User testing', () => { }); it('should send email when upgrading from anon', (done) => { - + let emailCalled = false; let emailOptions; var emailAdapter = { @@ -2768,7 +2768,7 @@ describe('Parse.User testing', () => { }); }); - it('should not fail querying non existing relations', done => { + it('should not fail querying non existing relations', done => { let user = new Parse.User(); user.set({ username: 'hello', diff --git a/spec/RestQuery.spec.js b/spec/RestQuery.spec.js index fbdf05e78f..745bf35915 100644 --- a/spec/RestQuery.spec.js +++ b/spec/RestQuery.spec.js @@ -172,7 +172,7 @@ describe('rest query', () => { 'X-Parse-Application-Id': 'test', 'X-Parse-REST-API-Key': 'rest' }; - + let p0 = rp.get({ headers: headers, url: 'http://localhost:8378/1/classes/TestParameterEncode?' diff --git a/spec/RevocableSessionsUpgrade.spec.js b/spec/RevocableSessionsUpgrade.spec.js index 50ee4cf68c..8589a73f17 100644 --- a/spec/RevocableSessionsUpgrade.spec.js +++ b/spec/RevocableSessionsUpgrade.spec.js @@ -109,4 +109,4 @@ describe_only_db('mongo')('revocable sessions', () => { done(); }); }); -}) \ No newline at end of file +}) diff --git a/spec/Schema.spec.js b/spec/Schema.spec.js index 30fd2ac924..ee22e0dd70 100644 --- a/spec/Schema.spec.js +++ b/spec/Schema.spec.js @@ -708,7 +708,7 @@ describe('SchemaController', () => { }, () => { expect(exist).toEqual(false); }); - + }) .then(() => schema.deleteField('relationField', 'NewClass', config.database)) .then(() => schema.reloadData()) diff --git a/spec/TwitterAuth.spec.js b/spec/TwitterAuth.spec.js index b7c69159ce..4c6ad55ab4 100644 --- a/spec/TwitterAuth.spec.js +++ b/spec/TwitterAuth.spec.js @@ -10,9 +10,9 @@ describe('Twitter Auth', () => { }, { consumer_key: 'world' }]).consumer_key).toEqual('hello') - + // Multiple options, consumer_key not found - expect(function(){ + expect(function(){ twitter.handleMultipleConfigurations({ consumer_key: 'some', }, [{ @@ -23,7 +23,7 @@ describe('Twitter Auth', () => { }).toThrow(); // Multiple options, consumer_key not found - expect(function(){ + expect(function(){ twitter.handleMultipleConfigurations({ auth_token: 'token', }, [{ @@ -47,4 +47,4 @@ describe('Twitter Auth', () => { consumer_key: 'hello' }).consumer_key).toEqual('hello'); }); -}); \ No newline at end of file +}); diff --git a/spec/helper.js b/spec/helper.js index 8b1cb1f232..7ff6a8bfd1 100644 --- a/spec/helper.js +++ b/spec/helper.js @@ -5,7 +5,7 @@ const SpecReporter = require('jasmine-spec-reporter'); jasmine.DEFAULT_TIMEOUT_INTERVAL = process.env.PARSE_SERVER_TEST_TIMEOUT || 5000; jasmine.getEnv().clearReporters(); -jasmine.getEnv().addReporter(new SpecReporter()); +jasmine.getEnv().addReporter(new SpecReporter()); global.on_db = (db, callback, elseCallback) => { if (process.env.PARSE_SERVER_TEST_DB == db) { diff --git a/spec/parsers.spec.js b/spec/parsers.spec.js index 48a1111f25..30032a7b91 100644 --- a/spec/parsers.spec.js +++ b/spec/parsers.spec.js @@ -31,4 +31,4 @@ describe('parsers', () => { expect(parser(1)).toEqual(true); expect(parser(2)).toEqual(false); }); -}); \ No newline at end of file +}); diff --git a/spec/rest.spec.js b/spec/rest.spec.js index f396e17395..0270cfc9b8 100644 --- a/spec/rest.spec.js +++ b/spec/rest.spec.js @@ -10,7 +10,7 @@ var config = new Config('test'); let database = config.database; describe('rest create', () => { - + beforeEach(() => { config = new Config('test'); });