fix(prettier): Properly handle lint-stage files (#6970)

Now handles top level files and recursive files in folders.

Set max line length to be 100
This commit is contained in:
Diamond Lewis
2020-10-25 15:06:58 -05:00
committed by GitHub
parent c2f2281e6d
commit e6ac3b6932
178 changed files with 5585 additions and 10688 deletions

View File

@@ -131,15 +131,11 @@ describe('Password Policy: ', () => {
publicServerURL: 'http://localhost:8378/1',
})
.then(() => {
fail(
'passwordPolicy.resetTokenValidityDuration "not a number" test failed'
);
fail('passwordPolicy.resetTokenValidityDuration "not a number" test failed');
done();
})
.catch(err => {
expect(err).toEqual(
'passwordPolicy.resetTokenValidityDuration must be a positive number'
);
expect(err).toEqual('passwordPolicy.resetTokenValidityDuration must be a positive number');
done();
});
});
@@ -157,9 +153,7 @@ describe('Password Policy: ', () => {
done();
})
.catch(err => {
expect(err).toEqual(
'passwordPolicy.resetTokenValidityDuration must be a positive number'
);
expect(err).toEqual('passwordPolicy.resetTokenValidityDuration must be a positive number');
done();
});
});
@@ -197,9 +191,7 @@ describe('Password Policy: ', () => {
done();
})
.catch(err => {
expect(err).toEqual(
'passwordPolicy.validatorCallback must be a function.'
);
expect(err).toEqual('passwordPolicy.validatorCallback must be a function.');
done();
});
});
@@ -219,9 +211,7 @@ describe('Password Policy: ', () => {
user
.signUp()
.then(() => {
fail(
'Should have failed as password does not conform to the policy.'
);
fail('Should have failed as password does not conform to the policy.');
done();
})
.catch(error => {
@@ -246,9 +236,7 @@ describe('Password Policy: ', () => {
user
.signUp()
.then(() => {
fail(
'Should have failed as password does not conform to the policy.'
);
fail('Should have failed as password does not conform to the policy.');
done();
})
.catch(error => {
@@ -273,15 +261,11 @@ describe('Password Policy: ', () => {
user
.signUp()
.then(() => {
fail(
'Should have failed as password does not conform to the policy.'
);
fail('Should have failed as password does not conform to the policy.');
done();
})
.catch(error => {
expect(error.message).toEqual(
'Cannot sign up user with an empty password.'
);
expect(error.message).toEqual('Cannot sign up user with an empty password.');
done();
});
});
@@ -305,7 +289,7 @@ describe('Password Policy: ', () => {
Parse.User.logOut()
.then(() => {
Parse.User.logIn('user1', '1digit')
.then(function() {
.then(function () {
done();
})
.catch(err => {
@@ -322,9 +306,7 @@ describe('Password Policy: ', () => {
})
.catch(error => {
jfail(error);
fail(
'Signup should have succeeded as password conforms to the policy.'
);
fail('Signup should have succeeded as password conforms to the policy.');
done();
});
});
@@ -348,7 +330,7 @@ describe('Password Policy: ', () => {
Parse.User.logOut()
.then(() => {
Parse.User.logIn('user1', 'p@sswrod')
.then(function() {
.then(function () {
done();
})
.catch(err => {
@@ -365,9 +347,7 @@ describe('Password Policy: ', () => {
})
.catch(error => {
jfail(error);
fail(
'Signup should have succeeded as password conforms to the policy.'
);
fail('Signup should have succeeded as password conforms to the policy.');
done();
});
});
@@ -388,9 +368,7 @@ describe('Password Policy: ', () => {
user
.signUp()
.then(() => {
fail(
'Should have failed as password does not conform to the policy.'
);
fail('Should have failed as password does not conform to the policy.');
done();
})
.catch(error => {
@@ -418,7 +396,7 @@ describe('Password Policy: ', () => {
Parse.User.logOut()
.then(() => {
Parse.User.logIn('user1', 'oneUpper')
.then(function() {
.then(function () {
done();
})
.catch(err => {
@@ -457,9 +435,7 @@ describe('Password Policy: ', () => {
user
.signUp()
.then(() => {
fail(
'Should have failed as password does not conform to the policy.'
);
fail('Should have failed as password does not conform to the policy.');
done();
})
.catch(error => {
@@ -485,9 +461,7 @@ describe('Password Policy: ', () => {
user
.signUp()
.then(() => {
fail(
'Should have failed as password does not conform to the policy.'
);
fail('Should have failed as password does not conform to the policy.');
done();
})
.catch(error => {
@@ -516,7 +490,7 @@ describe('Password Policy: ', () => {
Parse.User.logOut()
.then(() => {
Parse.User.logIn('user1', 'oneUpper')
.then(function() {
.then(function () {
done();
})
.catch(err => {
@@ -579,7 +553,7 @@ describe('Password Policy: ', () => {
);
Parse.User.logIn('user1', 'has2init')
.then(function() {
.then(function () {
done();
})
.catch(err => {
@@ -671,7 +645,7 @@ describe('Password Policy: ', () => {
);
Parse.User.logIn('user1', 'has 1 digit')
.then(function() {
.then(function () {
done();
})
.catch(err => {
@@ -737,9 +711,7 @@ describe('Password Policy: ', () => {
done();
})
.catch(err => {
expect(err).toEqual(
'passwordPolicy.doNotAllowUsername must be a boolean value.'
);
expect(err).toEqual('passwordPolicy.doNotAllowUsername must be a boolean value.');
done();
});
});
@@ -765,9 +737,7 @@ describe('Password Policy: ', () => {
})
.catch(error => {
expect(error.code).toEqual(142);
expect(error.message).toEqual(
'Password cannot contain your username.'
);
expect(error.message).toEqual('Password cannot contain your username.');
done();
});
});
@@ -861,7 +831,7 @@ describe('Password Policy: ', () => {
);
Parse.User.logIn('user1', 'r@nd0m')
.then(function() {
.then(function () {
done();
})
.catch(err => {
@@ -1012,7 +982,7 @@ describe('Password Policy: ', () => {
);
Parse.User.logIn('user1', 'uuser11')
.then(function() {
.then(function () {
done();
})
.catch(err => {
@@ -1075,9 +1045,7 @@ describe('Password Policy: ', () => {
done();
})
.catch(err => {
expect(err).toEqual(
'passwordPolicy.maxPasswordAge must be a positive number'
);
expect(err).toEqual('passwordPolicy.maxPasswordAge must be a positive number');
done();
});
});
@@ -1095,9 +1063,7 @@ describe('Password Policy: ', () => {
done();
})
.catch(err => {
expect(err).toEqual(
'passwordPolicy.maxPasswordAge must be a positive number'
);
expect(err).toEqual('passwordPolicy.maxPasswordAge must be a positive number');
done();
});
});
@@ -1207,9 +1173,7 @@ describe('Password Policy: ', () => {
done();
})
.catch(error => {
expect(error.code).toEqual(
Parse.Error.OBJECT_NOT_FOUND
);
expect(error.code).toEqual(Parse.Error.OBJECT_NOT_FOUND);
expect(error.message).toEqual(
'Your password has expired. Please reset your password.'
);
@@ -1284,7 +1248,7 @@ describe('Password Policy: ', () => {
);
Parse.User.logIn('user1', 'uuser11')
.then(function() {
.then(function () {
done();
})
.catch(err => {
@@ -1331,13 +1295,11 @@ describe('Password Policy: ', () => {
expect(error.message).toEqual(
'Your password has expired. Please reset your password.'
);
Parse.User.requestPasswordReset('user1@parse.com').catch(
err => {
jfail(err);
fail('Reset password request should not fail');
done();
}
);
Parse.User.requestPasswordReset('user1@parse.com').catch(err => {
jfail(err);
fail('Reset password request should not fail');
done();
});
});
}, 1000);
})
@@ -1362,9 +1324,7 @@ describe('Password Policy: ', () => {
done();
})
.catch(err => {
expect(err).toEqual(
'passwordPolicy.maxPasswordHistory must be an integer ranging 0 - 20'
);
expect(err).toEqual('passwordPolicy.maxPasswordHistory must be an integer ranging 0 - 20');
done();
});
});
@@ -1382,9 +1342,7 @@ describe('Password Policy: ', () => {
done();
})
.catch(err => {
expect(err).toEqual(
'passwordPolicy.maxPasswordHistory must be an integer ranging 0 - 20'
);
expect(err).toEqual('passwordPolicy.maxPasswordHistory must be an integer ranging 0 - 20');
done();
});
});
@@ -1402,9 +1360,7 @@ describe('Password Policy: ', () => {
done();
})
.catch(err => {
expect(err).toEqual(
'passwordPolicy.maxPasswordHistory must be an integer ranging 0 - 20'
);
expect(err).toEqual('passwordPolicy.maxPasswordHistory must be an integer ranging 0 - 20');
done();
});
});
@@ -1511,15 +1467,11 @@ describe('Password Policy: ', () => {
return user.save();
})
.then(() => {
fail(
'should have failed because the new password is same as the old'
);
fail('should have failed because the new password is same as the old');
done();
})
.catch(error => {
expect(error.message).toEqual(
'New password should not be the same as last 5 passwords.'
);
expect(error.message).toEqual('New password should not be the same as last 5 passwords.');
expect(error.code).toEqual(Parse.Error.VALIDATION_ERROR);
done();
});
@@ -1565,15 +1517,11 @@ describe('Password Policy: ', () => {
return user.save();
})
.then(() => {
fail(
'should have failed because the new password is same as the old'
);
fail('should have failed because the new password is same as the old');
done();
})
.catch(error => {
expect(error.message).toEqual(
'New password should not be the same as last 5 passwords.'
);
expect(error.message).toEqual('New password should not be the same as last 5 passwords.');
expect(error.code).toEqual(Parse.Error.VALIDATION_ERROR);
done();
});
@@ -1626,9 +1574,7 @@ describe('Password Policy: ', () => {
done();
})
.catch(() => {
fail(
'should have succeeded because the new password is not in history'
);
fail('should have succeeded because the new password is not in history');
done();
});
});
@@ -1663,8 +1609,6 @@ describe('Password Policy: ', () => {
const result2 = await query.get(user.id, { useMasterKey: true });
expect(result2.get('_password_history').length).toBe(1);
expect(result1.get('_password_history')).not.toEqual(
result2.get('_password_history')
);
expect(result1.get('_password_history')).not.toEqual(result2.get('_password_history'));
});
});