Skip to content

Commit 37daafc

Browse files
Arthur Cinaderflovilmart
Arthur Cinader
authored andcommitted
Add strip whitespace and trailing eol to spec too. (#3159)
1 parent 8359284 commit 37daafc

19 files changed

+38
-36
lines changed

spec/.eslintrc.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
},
3131
"rules": {
3232
"no-console": [0],
33-
"indent": ["error", 2]
33+
"indent": ["error", 2],
34+
"no-trailing-spaces": 2,
35+
"eol-last": 2
3436
}
35-
}
37+
}

spec/AccountLockoutPolicy.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ describe("Account Lockout Policy: ", () => {
263263
return isAccountLockoutError('username3', 'wrong password', 0.05, 1);
264264
})
265265
.then(() => {
266-
// account should still be locked even after 2 seconds.
266+
// account should still be locked even after 2 seconds.
267267
return isAccountLockoutError('username3', 'wrong password', 0.05, 2000);
268268
})
269269
.then(() => {
@@ -297,7 +297,7 @@ describe("Account Lockout Policy: ", () => {
297297
return loginWithWrongCredentialsShouldFail('username4', 'wrong password');
298298
})
299299
.then(() => {
300-
// allow locked user to login after 3 seconds with a valid userid and password
300+
// allow locked user to login after 3 seconds with a valid userid and password
301301
return new Promise((resolve, reject) => {
302302
setTimeout(() => {
303303
Parse.User.logIn('username4', 'correct password')

spec/Analytics.spec.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
const analyticsAdapter = {
2-
appOpened: function() {},
2+
appOpened: function() {},
33
trackEvent: function() {}
44
}
55

66
describe('AnalyticsController', () => {
77
it('should track a simple event', (done) => {
8-
8+
99
spyOn(analyticsAdapter, 'trackEvent').and.callThrough();
1010
reconfigureServer({
1111
analyticsAdapter
@@ -31,9 +31,9 @@ describe('AnalyticsController', () => {
3131
done();
3232
})
3333
});
34-
34+
3535
it('should track a app opened event', (done) => {
36-
36+
3737
spyOn(analyticsAdapter, 'appOpened').and.callThrough();
3838
reconfigureServer({
3939
analyticsAdapter
@@ -58,4 +58,4 @@ describe('AnalyticsController', () => {
5858
done();
5959
})
6060
})
61-
})
61+
})

spec/ClientSDK.spec.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ describe('ClientSDK', () => {
2020
version: '1.9.0'
2121
});
2222
});
23-
23+
2424
it('should properly sastisfy', () => {
2525
expect(ClientSDK.compatible({
2626
js: '>=1.9.0'
2727
})("js1.9.0")).toBe(true);
28-
28+
2929
expect(ClientSDK.compatible({
3030
js: '>=1.9.0'
3131
})("js2.0.0")).toBe(true);
@@ -38,4 +38,4 @@ describe('ClientSDK', () => {
3838
js: '>=1.9.0'
3939
})(undefined)).toBe(true);
4040
})
41-
})
41+
})

spec/HTTPRequest.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ describe("httpRequest", () => {
272272
Parse._encode(httpResponse);
273273
let serialized = JSON.stringify(httpResponse);
274274
let result = JSON.parse(serialized);
275-
275+
276276
expect(httpResponse.text).toEqual('{"foo":"bar"}');
277277
expect(httpResponse.data).toEqual({foo: 'bar'});
278278
expect(httpResponse.body).toEqual({foo: 'bar'});

spec/Middlewares.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,4 @@ describe('middlewares', () => {
120120
});
121121
});
122122
});
123-
});
123+
});

spec/MongoStorageAdapter.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,14 @@ describe_only_db('mongo')('MongoStorageAdapter', () => {
192192

193193
it("handles updating a single object with array, object date", (done) => {
194194
let adapter = new MongoStorageAdapter({ uri: databaseURI });
195-
195+
196196
let schema = { fields: {
197197
array: { type: 'Array' },
198198
object: { type: 'Object' },
199199
date: { type: 'Date' },
200200
} };
201201

202-
202+
203203
adapter.createObject('MyClass', schema, {})
204204
.then(() => adapter._rawFind('MyClass', {}))
205205
.then(results => {

spec/MongoTransform.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ describe('parseObjectToMongoObjectForCreate', () => {
242242
};
243243
var output = transform.parseObjectToMongoObjectForCreate(null, input, {
244244
fields: {
245-
aRelation: { __type: 'Relation', className: 'Stuff' },
245+
aRelation: { __type: 'Relation', className: 'Stuff' },
246246
},
247247
});
248248
expect(output).toEqual({});
@@ -302,7 +302,7 @@ describe('transformUpdate', () => {
302302
};
303303
var output = transform.transformUpdate(null, input, {
304304
fields: {
305-
aRelation: { __type: 'Relation', className: 'Stuff' },
305+
aRelation: { __type: 'Relation', className: 'Stuff' },
306306
},
307307
});
308308
expect(output).toEqual({});

spec/ParseInstallation.spec.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,9 @@ describe('Installations', () => {
288288
expect(results.length).toEqual(1);
289289
expect(results[0]['_id']).toEqual(secondObject._id);
290290
done();
291-
}).catch((error) => {
292-
jfail(error);
293-
done();
291+
}).catch((error) => {
292+
jfail(error);
293+
done();
294294
});
295295
});
296296

spec/ParseLiveQueryServer.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ describe('ParseLiveQueryServer', function() {
928928
}
929929
}
930930
});
931-
931+
932932
parseLiveQueryServer._matchesACL(acl, client, requestId).then(function(isMatched) {
933933
expect(isMatched).toBe(false);
934934
done();

spec/ParseServerRESTController.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,4 @@ describe('ParseServerRESTController', () => {
115115
done();
116116
});
117117
});
118-
});
118+
});

spec/ParseUser.spec.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -2385,7 +2385,7 @@ describe('Parse.User testing', () => {
23852385
req.object.set('foo', 'bar');
23862386
res.success();
23872387
});
2388-
2388+
23892389
let originalSessionToken;
23902390
let originalUserId;
23912391
// Simulate anonymous user save
@@ -2463,7 +2463,7 @@ describe('Parse.User testing', () => {
24632463
});
24642464

24652465
it('should send email when upgrading from anon', (done) => {
2466-
2466+
24672467
let emailCalled = false;
24682468
let emailOptions;
24692469
var emailAdapter = {
@@ -2768,7 +2768,7 @@ describe('Parse.User testing', () => {
27682768
});
27692769
});
27702770

2771-
it('should not fail querying non existing relations', done => {
2771+
it('should not fail querying non existing relations', done => {
27722772
let user = new Parse.User();
27732773
user.set({
27742774
username: 'hello',

spec/RestQuery.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ describe('rest query', () => {
172172
'X-Parse-Application-Id': 'test',
173173
'X-Parse-REST-API-Key': 'rest'
174174
};
175-
175+
176176
let p0 = rp.get({
177177
headers: headers,
178178
url: 'http://localhost:8378/1/classes/TestParameterEncode?'

spec/RevocableSessionsUpgrade.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,4 @@ describe_only_db('mongo')('revocable sessions', () => {
109109
done();
110110
});
111111
});
112-
})
112+
})

spec/Schema.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ describe('SchemaController', () => {
708708
}, () => {
709709
expect(exist).toEqual(false);
710710
});
711-
711+
712712
})
713713
.then(() => schema.deleteField('relationField', 'NewClass', config.database))
714714
.then(() => schema.reloadData())

spec/TwitterAuth.spec.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ describe('Twitter Auth', () => {
1010
}, {
1111
consumer_key: 'world'
1212
}]).consumer_key).toEqual('hello')
13-
13+
1414
// Multiple options, consumer_key not found
15-
expect(function(){
15+
expect(function(){
1616
twitter.handleMultipleConfigurations({
1717
consumer_key: 'some',
1818
}, [{
@@ -23,7 +23,7 @@ describe('Twitter Auth', () => {
2323
}).toThrow();
2424

2525
// Multiple options, consumer_key not found
26-
expect(function(){
26+
expect(function(){
2727
twitter.handleMultipleConfigurations({
2828
auth_token: 'token',
2929
}, [{
@@ -47,4 +47,4 @@ describe('Twitter Auth', () => {
4747
consumer_key: 'hello'
4848
}).consumer_key).toEqual('hello');
4949
});
50-
});
50+
});

spec/helper.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const SpecReporter = require('jasmine-spec-reporter');
55
jasmine.DEFAULT_TIMEOUT_INTERVAL = process.env.PARSE_SERVER_TEST_TIMEOUT || 5000;
66

77
jasmine.getEnv().clearReporters();
8-
jasmine.getEnv().addReporter(new SpecReporter());
8+
jasmine.getEnv().addReporter(new SpecReporter());
99

1010
global.on_db = (db, callback, elseCallback) => {
1111
if (process.env.PARSE_SERVER_TEST_DB == db) {

spec/parsers.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ describe('parsers', () => {
3131
expect(parser(1)).toEqual(true);
3232
expect(parser(2)).toEqual(false);
3333
});
34-
});
34+
});

spec/rest.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var config = new Config('test');
1010
let database = config.database;
1111

1212
describe('rest create', () => {
13-
13+
1414
beforeEach(() => {
1515
config = new Config('test');
1616
});

0 commit comments

Comments
 (0)