feat: Upgrade to Parse JS SDK 6.0.0 (#9624)
BREAKING CHANGE: This upgrades to the Parse JS SDK 6.0.0. See the [change log](https://github.com/parse-community/Parse-SDK-JS/releases/tag/6.0.0) of the Parse JS SDK for breaking changes and more details.
This commit is contained in:
@@ -3494,9 +3494,17 @@ describe('afterLogin hook', () => {
|
||||
expect(req.object._context).not.toBeDefined();
|
||||
expect(req.object.context).not.toBeDefined();
|
||||
});
|
||||
const obj = new TestObject();
|
||||
obj.set('_context', { hello: 'world' });
|
||||
await obj.save(null, { context: { a: 'a' } });
|
||||
await request({
|
||||
url: 'http://localhost:8378/1/classes/TestObject',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-Parse-Application-Id': 'test',
|
||||
'X-Parse-REST-API-Key': 'rest',
|
||||
'X-Parse-Cloud-Context': '{"a":"a"}',
|
||||
},
|
||||
body: JSON.stringify({_context: { hello: 'world' }}),
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
it('should have access to context when saving a new object', async () => {
|
||||
|
||||
@@ -5,17 +5,9 @@ const Config = require('../lib/Config');
|
||||
const auth = require('../lib/Auth');
|
||||
|
||||
describe('Parse.ACL', () => {
|
||||
it('acl must be valid', done => {
|
||||
it('acl must be valid', () => {
|
||||
const user = new Parse.User();
|
||||
ok(
|
||||
!user.setACL("Ceci n'est pas un ACL.", {
|
||||
error: function (user, error) {
|
||||
equal(error.code, -1);
|
||||
done();
|
||||
},
|
||||
}),
|
||||
'setACL should have returned false.'
|
||||
);
|
||||
expect(() => user.setACL('ACL')).toThrow(new Parse.Error(Parse.Error.OTHER_CAUSE, 'ACL must be a Parse ACL.'));
|
||||
});
|
||||
|
||||
it('refresh object with acl', async done => {
|
||||
|
||||
@@ -302,7 +302,7 @@ describe('Parse.Object testing', () => {
|
||||
|
||||
it('invalid key name', function (done) {
|
||||
const item = new Parse.Object('Item');
|
||||
ok(!item.set({ 'foo^bar': 'baz' }), 'Item should not be updated with invalid key.');
|
||||
expect(() => item.set({ 'foo^bar': 'baz' })).toThrow(new Parse.Error(Parse.Error.INVALID_KEY_NAME, 'Invalid key name: "foo^bar"'));
|
||||
item.save({ 'foo^bar': 'baz' }).then(fail, () => done());
|
||||
});
|
||||
|
||||
|
||||
@@ -2817,7 +2817,7 @@ describe('schemas', () => {
|
||||
object.save({
|
||||
'!12field': 'field',
|
||||
})
|
||||
).toBeRejectedWith(new Parse.Error(Parse.Error.INVALID_KEY_NAME));
|
||||
).toBeRejectedWith(new Parse.Error(Parse.Error.INVALID_KEY_NAME, 'Invalid key name: "!12field"'));
|
||||
done();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user