Update dependencies to enable Greenkeeper 🌴 (#3940)
* chore(package): update dependencies * docs(readme): add Greenkeeper badge * Fix indent issues with eslint 4.0 see http://eslint.org/docs/user-guide/migrating-to-4.0.0\#-the-indent-rule-is-more-strict
This commit is contained in:
committed by
Arthur Cinader
parent
16954c2f74
commit
e94991b368
@@ -88,27 +88,27 @@ describe('miscellaneous', function() {
|
||||
numCreated++;
|
||||
expect(numCreated).toEqual(1);
|
||||
})
|
||||
.catch(error => {
|
||||
numFailed++;
|
||||
expect(numFailed).toEqual(1);
|
||||
expect(error.code).toEqual(Parse.Error.USERNAME_TAKEN);
|
||||
});
|
||||
.catch(error => {
|
||||
numFailed++;
|
||||
expect(numFailed).toEqual(1);
|
||||
expect(error.code).toEqual(Parse.Error.USERNAME_TAKEN);
|
||||
});
|
||||
const p2 = createTestUser();
|
||||
p2.then(() => {
|
||||
numCreated++;
|
||||
expect(numCreated).toEqual(1);
|
||||
})
|
||||
.catch(error => {
|
||||
numFailed++;
|
||||
expect(numFailed).toEqual(1);
|
||||
expect(error.code).toEqual(Parse.Error.USERNAME_TAKEN);
|
||||
});
|
||||
.catch(error => {
|
||||
numFailed++;
|
||||
expect(numFailed).toEqual(1);
|
||||
expect(error.code).toEqual(Parse.Error.USERNAME_TAKEN);
|
||||
});
|
||||
Parse.Promise.when([p1, p2])
|
||||
.then(() => {
|
||||
fail('one of the users should not have been created');
|
||||
done();
|
||||
})
|
||||
.catch(done);
|
||||
.then(() => {
|
||||
fail('one of the users should not have been created');
|
||||
done();
|
||||
})
|
||||
.catch(done);
|
||||
});
|
||||
|
||||
it('ensure that email is uniquely indexed', done => {
|
||||
@@ -143,97 +143,97 @@ describe('miscellaneous', function() {
|
||||
});
|
||||
|
||||
Parse.Promise.when([p1, p2])
|
||||
.then(() => {
|
||||
fail('one of the users should not have been created');
|
||||
done();
|
||||
})
|
||||
.catch(done);
|
||||
.then(() => {
|
||||
fail('one of the users should not have been created');
|
||||
done();
|
||||
})
|
||||
.catch(done);
|
||||
});
|
||||
|
||||
it('ensure that if people already have duplicate users, they can still sign up new users', done => {
|
||||
const config = new Config('test');
|
||||
// Remove existing data to clear out unique index
|
||||
TestUtils.destroyAllDataPermanently()
|
||||
.then(() => config.database.adapter.createClass('_User', userSchema))
|
||||
.then(() => config.database.adapter.createObject('_User', userSchema, { objectId: 'x', username: 'u' }).catch(fail))
|
||||
.then(() => config.database.adapter.createObject('_User', userSchema, { objectId: 'y', username: 'u' }).catch(fail))
|
||||
.then(() => config.database.adapter.createClass('_User', userSchema))
|
||||
.then(() => config.database.adapter.createObject('_User', userSchema, { objectId: 'x', username: 'u' }).catch(fail))
|
||||
.then(() => config.database.adapter.createObject('_User', userSchema, { objectId: 'y', username: 'u' }).catch(fail))
|
||||
// Create a new server to try to recreate the unique indexes
|
||||
.then(reconfigureServer)
|
||||
.catch(error => {
|
||||
expect(error.code).toEqual(Parse.Error.DUPLICATE_VALUE);
|
||||
const user = new Parse.User();
|
||||
user.setPassword('asdf');
|
||||
user.setUsername('zxcv');
|
||||
return user.signUp().catch(fail);
|
||||
})
|
||||
.then(() => {
|
||||
const user = new Parse.User();
|
||||
user.setPassword('asdf');
|
||||
user.setUsername('u');
|
||||
return user.signUp()
|
||||
})
|
||||
.then(() => {
|
||||
fail('should not have been able to sign up');
|
||||
done();
|
||||
})
|
||||
.catch(error => {
|
||||
expect(error.code).toEqual(Parse.Error.USERNAME_TAKEN);
|
||||
done();
|
||||
})
|
||||
.then(reconfigureServer)
|
||||
.catch(error => {
|
||||
expect(error.code).toEqual(Parse.Error.DUPLICATE_VALUE);
|
||||
const user = new Parse.User();
|
||||
user.setPassword('asdf');
|
||||
user.setUsername('zxcv');
|
||||
return user.signUp().catch(fail);
|
||||
})
|
||||
.then(() => {
|
||||
const user = new Parse.User();
|
||||
user.setPassword('asdf');
|
||||
user.setUsername('u');
|
||||
return user.signUp()
|
||||
})
|
||||
.then(() => {
|
||||
fail('should not have been able to sign up');
|
||||
done();
|
||||
})
|
||||
.catch(error => {
|
||||
expect(error.code).toEqual(Parse.Error.USERNAME_TAKEN);
|
||||
done();
|
||||
})
|
||||
});
|
||||
|
||||
it('ensure that if people already have duplicate emails, they can still sign up new users', done => {
|
||||
const config = new Config('test');
|
||||
// Remove existing data to clear out unique index
|
||||
TestUtils.destroyAllDataPermanently()
|
||||
.then(() => config.database.adapter.createClass('_User', userSchema))
|
||||
.then(() => config.database.adapter.createObject('_User', userSchema, { objectId: 'x', email: 'a@b.c' }))
|
||||
.then(() => config.database.adapter.createObject('_User', userSchema, { objectId: 'y', email: 'a@b.c' }))
|
||||
.then(reconfigureServer)
|
||||
.catch(() => {
|
||||
const user = new Parse.User();
|
||||
user.setPassword('asdf');
|
||||
user.setUsername('qqq');
|
||||
user.setEmail('unique@unique.unique');
|
||||
return user.signUp().catch(fail);
|
||||
})
|
||||
.then(() => {
|
||||
const user = new Parse.User();
|
||||
user.setPassword('asdf');
|
||||
user.setUsername('www');
|
||||
user.setEmail('a@b.c');
|
||||
return user.signUp()
|
||||
})
|
||||
.catch(error => {
|
||||
expect(error.code).toEqual(Parse.Error.EMAIL_TAKEN);
|
||||
done();
|
||||
});
|
||||
.then(() => config.database.adapter.createClass('_User', userSchema))
|
||||
.then(() => config.database.adapter.createObject('_User', userSchema, { objectId: 'x', email: 'a@b.c' }))
|
||||
.then(() => config.database.adapter.createObject('_User', userSchema, { objectId: 'y', email: 'a@b.c' }))
|
||||
.then(reconfigureServer)
|
||||
.catch(() => {
|
||||
const user = new Parse.User();
|
||||
user.setPassword('asdf');
|
||||
user.setUsername('qqq');
|
||||
user.setEmail('unique@unique.unique');
|
||||
return user.signUp().catch(fail);
|
||||
})
|
||||
.then(() => {
|
||||
const user = new Parse.User();
|
||||
user.setPassword('asdf');
|
||||
user.setUsername('www');
|
||||
user.setEmail('a@b.c');
|
||||
return user.signUp()
|
||||
})
|
||||
.catch(error => {
|
||||
expect(error.code).toEqual(Parse.Error.EMAIL_TAKEN);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('ensure that if you try to sign up a user with a unique username and email, but duplicates in some other field that has a uniqueness constraint, you get a regular duplicate value error', done => {
|
||||
const config = new Config('test');
|
||||
config.database.adapter.addFieldIfNotExists('_User', 'randomField', { type: 'String' })
|
||||
.then(() => config.database.adapter.ensureUniqueness('_User', userSchema, ['randomField']))
|
||||
.then(() => {
|
||||
const user = new Parse.User();
|
||||
user.setPassword('asdf');
|
||||
user.setUsername('1');
|
||||
user.setEmail('1@b.c');
|
||||
user.set('randomField', 'a');
|
||||
return user.signUp()
|
||||
})
|
||||
.then(() => {
|
||||
const user = new Parse.User();
|
||||
user.setPassword('asdf');
|
||||
user.setUsername('2');
|
||||
user.setEmail('2@b.c');
|
||||
user.set('randomField', 'a');
|
||||
return user.signUp()
|
||||
})
|
||||
.catch(error => {
|
||||
expect(error.code).toEqual(Parse.Error.DUPLICATE_VALUE);
|
||||
done();
|
||||
});
|
||||
.then(() => config.database.adapter.ensureUniqueness('_User', userSchema, ['randomField']))
|
||||
.then(() => {
|
||||
const user = new Parse.User();
|
||||
user.setPassword('asdf');
|
||||
user.setUsername('1');
|
||||
user.setEmail('1@b.c');
|
||||
user.set('randomField', 'a');
|
||||
return user.signUp()
|
||||
})
|
||||
.then(() => {
|
||||
const user = new Parse.User();
|
||||
user.setPassword('asdf');
|
||||
user.setUsername('2');
|
||||
user.setEmail('2@b.c');
|
||||
user.set('randomField', 'a');
|
||||
return user.signUp()
|
||||
})
|
||||
.catch(error => {
|
||||
expect(error.code).toEqual(Parse.Error.DUPLICATE_VALUE);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('succeed in logging in', function(done) {
|
||||
@@ -265,15 +265,15 @@ describe('miscellaneous', function() {
|
||||
user.increment('foo');
|
||||
return user.save();
|
||||
}).then(() => Parse.User.logOut())
|
||||
.then(() => Parse.User.logIn('test', 'moon-y'))
|
||||
.then((user) => {
|
||||
expect(user.get('foo')).toEqual(2);
|
||||
Parse.User.logOut()
|
||||
.then(done);
|
||||
}, (error) => {
|
||||
fail(JSON.stringify(error));
|
||||
done();
|
||||
});
|
||||
.then(() => Parse.User.logIn('test', 'moon-y'))
|
||||
.then((user) => {
|
||||
expect(user.get('foo')).toEqual(2);
|
||||
Parse.User.logOut()
|
||||
.then(done);
|
||||
}, (error) => {
|
||||
fail(JSON.stringify(error));
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('save various data types', function(done) {
|
||||
@@ -1028,12 +1028,12 @@ describe('miscellaneous', function() {
|
||||
});
|
||||
|
||||
Parse.Cloud.run('func', {nullParam: null})
|
||||
.then(() => {
|
||||
done()
|
||||
}, () => {
|
||||
fail('cloud code call failed');
|
||||
done();
|
||||
});
|
||||
.then(() => {
|
||||
done()
|
||||
}, () => {
|
||||
fail('cloud code call failed');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('can handle date params in cloud functions (#2214)', done => {
|
||||
@@ -1045,12 +1045,12 @@ describe('miscellaneous', function() {
|
||||
});
|
||||
|
||||
Parse.Cloud.run('dateFunc', {date: date})
|
||||
.then(() => {
|
||||
done()
|
||||
}, () => {
|
||||
fail('cloud code call failed');
|
||||
done();
|
||||
});
|
||||
.then(() => {
|
||||
done()
|
||||
}, () => {
|
||||
fail('cloud code call failed');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('fails on invalid client key', done => {
|
||||
@@ -1296,94 +1296,94 @@ describe('miscellaneous', function() {
|
||||
const obj = new Parse.Object('Obj');
|
||||
obj.set('val', { createdAt: 'a', updatedAt: 1 });
|
||||
obj.save()
|
||||
.then(obj => new Parse.Query('Obj').get(obj.id))
|
||||
.then(obj => {
|
||||
expect(obj.get('val').createdAt).toEqual('a');
|
||||
expect(obj.get('val').updatedAt).toEqual(1);
|
||||
done();
|
||||
});
|
||||
.then(obj => new Parse.Query('Obj').get(obj.id))
|
||||
.then(obj => {
|
||||
expect(obj.get('val').createdAt).toEqual('a');
|
||||
expect(obj.get('val').updatedAt).toEqual(1);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('bans interior keys containing . or $', done => {
|
||||
new Parse.Object('Obj').save({innerObj: {'key with a $': 'fails'}})
|
||||
.then(() => {
|
||||
fail('should not succeed')
|
||||
}, error => {
|
||||
expect(error.code).toEqual(Parse.Error.INVALID_NESTED_KEY);
|
||||
return new Parse.Object('Obj').save({innerObj: {'key with a .': 'fails'}});
|
||||
})
|
||||
.then(() => {
|
||||
fail('should not succeed')
|
||||
}, error => {
|
||||
expect(error.code).toEqual(Parse.Error.INVALID_NESTED_KEY);
|
||||
return new Parse.Object('Obj').save({innerObj: {innerInnerObj: {'key with $': 'fails'}}});
|
||||
})
|
||||
.then(() => {
|
||||
fail('should not succeed')
|
||||
}, error => {
|
||||
expect(error.code).toEqual(Parse.Error.INVALID_NESTED_KEY);
|
||||
return new Parse.Object('Obj').save({innerObj: {innerInnerObj: {'key with .': 'fails'}}});
|
||||
})
|
||||
.then(() => {
|
||||
fail('should not succeed')
|
||||
done();
|
||||
}, error => {
|
||||
expect(error.code).toEqual(Parse.Error.INVALID_NESTED_KEY);
|
||||
done();
|
||||
});
|
||||
.then(() => {
|
||||
fail('should not succeed')
|
||||
}, error => {
|
||||
expect(error.code).toEqual(Parse.Error.INVALID_NESTED_KEY);
|
||||
return new Parse.Object('Obj').save({innerObj: {'key with a .': 'fails'}});
|
||||
})
|
||||
.then(() => {
|
||||
fail('should not succeed')
|
||||
}, error => {
|
||||
expect(error.code).toEqual(Parse.Error.INVALID_NESTED_KEY);
|
||||
return new Parse.Object('Obj').save({innerObj: {innerInnerObj: {'key with $': 'fails'}}});
|
||||
})
|
||||
.then(() => {
|
||||
fail('should not succeed')
|
||||
}, error => {
|
||||
expect(error.code).toEqual(Parse.Error.INVALID_NESTED_KEY);
|
||||
return new Parse.Object('Obj').save({innerObj: {innerInnerObj: {'key with .': 'fails'}}});
|
||||
})
|
||||
.then(() => {
|
||||
fail('should not succeed')
|
||||
done();
|
||||
}, error => {
|
||||
expect(error.code).toEqual(Parse.Error.INVALID_NESTED_KEY);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('does not change inner object keys named _auth_data_something', done => {
|
||||
new Parse.Object('O').save({ innerObj: {_auth_data_facebook: 7}})
|
||||
.then(object => new Parse.Query('O').get(object.id))
|
||||
.then(object => {
|
||||
expect(object.get('innerObj')).toEqual({_auth_data_facebook: 7});
|
||||
done();
|
||||
});
|
||||
.then(object => new Parse.Query('O').get(object.id))
|
||||
.then(object => {
|
||||
expect(object.get('innerObj')).toEqual({_auth_data_facebook: 7});
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('does not change inner object key names _p_somethign', done => {
|
||||
new Parse.Object('O').save({ innerObj: {_p_data: 7}})
|
||||
.then(object => new Parse.Query('O').get(object.id))
|
||||
.then(object => {
|
||||
expect(object.get('innerObj')).toEqual({_p_data: 7});
|
||||
done();
|
||||
});
|
||||
.then(object => new Parse.Query('O').get(object.id))
|
||||
.then(object => {
|
||||
expect(object.get('innerObj')).toEqual({_p_data: 7});
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('does not change inner object key names _rperm, _wperm', done => {
|
||||
new Parse.Object('O').save({ innerObj: {_rperm: 7, _wperm: 8}})
|
||||
.then(object => new Parse.Query('O').get(object.id))
|
||||
.then(object => {
|
||||
expect(object.get('innerObj')).toEqual({_rperm: 7, _wperm: 8});
|
||||
done();
|
||||
});
|
||||
.then(object => new Parse.Query('O').get(object.id))
|
||||
.then(object => {
|
||||
expect(object.get('innerObj')).toEqual({_rperm: 7, _wperm: 8});
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('does not change inner objects if the key has the same name as a geopoint field on the class, and the value is an array of length 2, or if the key has the same name as a file field on the class, and the value is a string', done => {
|
||||
const file = new Parse.File('myfile.txt', { base64: 'eAo=' });
|
||||
file.save()
|
||||
.then(f => {
|
||||
const obj = new Parse.Object('O');
|
||||
obj.set('fileField', f);
|
||||
obj.set('geoField', new Parse.GeoPoint(0, 0));
|
||||
obj.set('innerObj', {
|
||||
fileField: "data",
|
||||
geoField: [1,2],
|
||||
.then(f => {
|
||||
const obj = new Parse.Object('O');
|
||||
obj.set('fileField', f);
|
||||
obj.set('geoField', new Parse.GeoPoint(0, 0));
|
||||
obj.set('innerObj', {
|
||||
fileField: "data",
|
||||
geoField: [1,2],
|
||||
});
|
||||
return obj.save();
|
||||
})
|
||||
.then(object => object.fetch())
|
||||
.then(object => {
|
||||
expect(object.get('innerObj')).toEqual({
|
||||
fileField: "data",
|
||||
geoField: [1,2],
|
||||
});
|
||||
done();
|
||||
}).catch((e) => {
|
||||
jfail(e);
|
||||
done();
|
||||
});
|
||||
return obj.save();
|
||||
})
|
||||
.then(object => object.fetch())
|
||||
.then(object => {
|
||||
expect(object.get('innerObj')).toEqual({
|
||||
fileField: "data",
|
||||
geoField: [1,2],
|
||||
});
|
||||
done();
|
||||
}).catch((e) => {
|
||||
jfail(e);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('purge all objects in class', (done) => {
|
||||
@@ -1392,29 +1392,29 @@ describe('miscellaneous', function() {
|
||||
const object2 = new Parse.Object('TestObject');
|
||||
object2.set('alice', 'wonderland');
|
||||
Parse.Object.saveAll([object, object2])
|
||||
.then(() => {
|
||||
const query = new Parse.Query(TestObject);
|
||||
return query.count()
|
||||
}).then((count) => {
|
||||
expect(count).toBe(2);
|
||||
const headers = {
|
||||
'Content-Type': 'application/json',
|
||||
'X-Parse-Application-Id': 'test',
|
||||
'X-Parse-Master-Key': 'test'
|
||||
};
|
||||
request.del({
|
||||
headers: headers,
|
||||
url: 'http://localhost:8378/1/purge/TestObject',
|
||||
json: true
|
||||
}, (err) => {
|
||||
expect(err).toBe(null);
|
||||
.then(() => {
|
||||
const query = new Parse.Query(TestObject);
|
||||
return query.count().then((count) => {
|
||||
expect(count).toBe(0);
|
||||
done();
|
||||
return query.count()
|
||||
}).then((count) => {
|
||||
expect(count).toBe(2);
|
||||
const headers = {
|
||||
'Content-Type': 'application/json',
|
||||
'X-Parse-Application-Id': 'test',
|
||||
'X-Parse-Master-Key': 'test'
|
||||
};
|
||||
request.del({
|
||||
headers: headers,
|
||||
url: 'http://localhost:8378/1/purge/TestObject',
|
||||
json: true
|
||||
}, (err) => {
|
||||
expect(err).toBe(null);
|
||||
const query = new Parse.Query(TestObject);
|
||||
return query.count().then((count) => {
|
||||
expect(count).toBe(0);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('fail on purge all objects in class without master key', (done) => {
|
||||
@@ -1549,7 +1549,7 @@ describe_only_db('mongo')('legacy _acl', () => {
|
||||
const config = new Config('test');
|
||||
const adapter = config.database.adapter;
|
||||
return adapter._adaptiveCollection("Report")
|
||||
.then(collection => collection.find({}))
|
||||
.then(collection => collection.find({}))
|
||||
}).then((results) => {
|
||||
expect(results.length).toBe(1);
|
||||
const result = results[0];
|
||||
|
||||
Reference in New Issue
Block a user