Skip to content

Commit bf9db75

Browse files
authored
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.
1 parent 275fe37 commit bf9db75

6 files changed

+144
-45
lines changed

package-lock.json

+128-29
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"mongodb": "6.13.0",
5151
"mustache": "4.2.0",
5252
"otpauth": "9.3.6",
53-
"parse": "5.3.0",
53+
"parse": "6.0.0",
5454
"path-to-regexp": "6.3.0",
5555
"pg-monitor": "2.1.0",
5656
"pg-promise": "11.10.2",

spec/CloudCode.spec.js

+11-3
Original file line numberDiff line numberDiff line change
@@ -3494,9 +3494,17 @@ describe('afterLogin hook', () => {
34943494
expect(req.object._context).not.toBeDefined();
34953495
expect(req.object.context).not.toBeDefined();
34963496
});
3497-
const obj = new TestObject();
3498-
obj.set('_context', { hello: 'world' });
3499-
await obj.save(null, { context: { a: 'a' } });
3497+
await request({
3498+
url: 'http://localhost:8378/1/classes/TestObject',
3499+
method: 'POST',
3500+
headers: {
3501+
'X-Parse-Application-Id': 'test',
3502+
'X-Parse-REST-API-Key': 'rest',
3503+
'X-Parse-Cloud-Context': '{"a":"a"}',
3504+
},
3505+
body: JSON.stringify({_context: { hello: 'world' }}),
3506+
});
3507+
35003508
});
35013509

35023510
it('should have access to context when saving a new object', async () => {

spec/ParseACL.spec.js

+2-10
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,9 @@ const Config = require('../lib/Config');
55
const auth = require('../lib/Auth');
66

77
describe('Parse.ACL', () => {
8-
it('acl must be valid', done => {
8+
it('acl must be valid', () => {
99
const user = new Parse.User();
10-
ok(
11-
!user.setACL("Ceci n'est pas un ACL.", {
12-
error: function (user, error) {
13-
equal(error.code, -1);
14-
done();
15-
},
16-
}),
17-
'setACL should have returned false.'
18-
);
10+
expect(() => user.setACL('ACL')).toThrow(new Parse.Error(Parse.Error.OTHER_CAUSE, 'ACL must be a Parse ACL.'));
1911
});
2012

2113
it('refresh object with acl', async done => {

spec/ParseObject.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ describe('Parse.Object testing', () => {
302302

303303
it('invalid key name', function (done) {
304304
const item = new Parse.Object('Item');
305-
ok(!item.set({ 'foo^bar': 'baz' }), 'Item should not be updated with invalid key.');
305+
expect(() => item.set({ 'foo^bar': 'baz' })).toThrow(new Parse.Error(Parse.Error.INVALID_KEY_NAME, 'Invalid key name: "foo^bar"'));
306306
item.save({ 'foo^bar': 'baz' }).then(fail, () => done());
307307
});
308308

spec/schemas.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2817,7 +2817,7 @@ describe('schemas', () => {
28172817
object.save({
28182818
'!12field': 'field',
28192819
})
2820-
).toBeRejectedWith(new Parse.Error(Parse.Error.INVALID_KEY_NAME));
2820+
).toBeRejectedWith(new Parse.Error(Parse.Error.INVALID_KEY_NAME, 'Invalid key name: "!12field"'));
28212821
done();
28222822
});
28232823

0 commit comments

Comments
 (0)