Add strip whitespace and trailing eol to spec too. (#3159)

This commit is contained in:
Arthur Cinader
2016-12-01 18:45:49 -08:00
committed by Florent Vilmart
parent 8359284329
commit 37daafc7b0
19 changed files with 38 additions and 36 deletions

View File

@@ -30,6 +30,8 @@
},
"rules": {
"no-console": [0],
"indent": ["error", 2]
"indent": ["error", 2],
"no-trailing-spaces": 2,
"eol-last": 2
}
}
}

View File

@@ -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')

View File

@@ -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();
})
})
})
})

View File

@@ -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);
})
})
})

View File

@@ -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'});

View File

@@ -120,4 +120,4 @@ describe('middlewares', () => {
});
});
});
});
});

View File

@@ -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 => {

View File

@@ -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({});

View File

@@ -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();
});
});

View File

@@ -928,7 +928,7 @@ describe('ParseLiveQueryServer', function() {
}
}
});
parseLiveQueryServer._matchesACL(acl, client, requestId).then(function(isMatched) {
expect(isMatched).toBe(false);
done();

View File

@@ -115,4 +115,4 @@ describe('ParseServerRESTController', () => {
done();
});
});
});
});

View File

@@ -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',

View File

@@ -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?'

View File

@@ -109,4 +109,4 @@ describe_only_db('mongo')('revocable sessions', () => {
done();
});
});
})
})

View File

@@ -708,7 +708,7 @@ describe('SchemaController', () => {
}, () => {
expect(exist).toEqual(false);
});
})
.then(() => schema.deleteField('relationField', 'NewClass', config.database))
.then(() => schema.reloadData())

View File

@@ -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');
});
});
});

View File

@@ -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) {

View File

@@ -31,4 +31,4 @@ describe('parsers', () => {
expect(parser(1)).toEqual(true);
expect(parser(2)).toEqual(false);
});
});
});

View File

@@ -10,7 +10,7 @@ var config = new Config('test');
let database = config.database;
describe('rest create', () => {
beforeEach(() => {
config = new Config('test');
});