More lint tweaking (#3164)

1. Add no space in paren rule
2. fix spec/eslintrc.json so it allow for inheriting from root rc.

Because the spce rc specified reccomended, it "turned off" all of the
rule tweaks in the root.  This fixes that.
This commit is contained in:
Arthur Cinader
2016-12-02 16:11:54 -08:00
committed by Florent Vilmart
parent b9afccd338
commit a270632570
19 changed files with 51 additions and 56 deletions

View File

@@ -98,10 +98,10 @@ describe('Parse Role testing', () => {
var user,
auth,
getAllRolesSpy;
createTestUser().then( (newUser) => {
createTestUser().then((newUser) => {
user = newUser;
return createAllRoles(user);
}).then ( (roles) => {
}).then ((roles) => {
var rootRoleObj = roleObjs[rootRole];
roles.forEach(function(role, i) {
// Add all roles to the RootRole
@@ -115,12 +115,12 @@ describe('Parse Role testing', () => {
});
return Parse.Object.saveAll(roles, { useMasterKey: true });
}).then( () => {
}).then(() => {
auth = new Auth({config: new Config("test"), isMaster: true, user: user});
getAllRolesSpy = spyOn(auth, "_getAllRolesNamesForRoleIds").and.callThrough();
return auth._loadRoles();
}).then ( (roles) => {
}).then ((roles) => {
expect(roles.length).toEqual(4);
allRoles.forEach(function(name) {
@@ -135,7 +135,7 @@ describe('Parse Role testing', () => {
// 1 call for the 2nd layer
expect(getAllRolesSpy.calls.count()).toEqual(2);
done()
}).catch( () => {
}).catch(() => {
fail("should succeed");
done();
});
@@ -145,26 +145,26 @@ describe('Parse Role testing', () => {
it("should recursively load roles", (done) => {
var rolesNames = ["FooRole", "BarRole", "BazRole"];
var roleIds = {};
createTestUser().then( (user) => {
createTestUser().then((user) => {
// Put the user on the 1st role
return createRole(rolesNames[0], null, user).then( (aRole) => {
return createRole(rolesNames[0], null, user).then((aRole) => {
roleIds[aRole.get("name")] = aRole.id;
// set the 1st role as a sibling of the second
// user will should have 2 role now
return createRole(rolesNames[1], aRole, null);
}).then( (anotherRole) => {
}).then((anotherRole) => {
roleIds[anotherRole.get("name")] = anotherRole.id;
// set this role as a sibling of the last
// the user should now have 3 roles
return createRole(rolesNames[2], anotherRole, null);
}).then( (lastRole) => {
}).then((lastRole) => {
roleIds[lastRole.get("name")] = lastRole.id;
var auth = new Auth({ config: new Config("test"), isMaster: true, user: user });
return auth._loadRoles();
})
}).then( (roles) => {
}).then((roles) => {
expect(roles.length).toEqual(3);
rolesNames.forEach( (name) => {
rolesNames.forEach((name) => {
expect(roles.indexOf('role:'+name)).not.toBe(-1);
});
done();