Skip to content

Commit b8e68e9

Browse files
committed
Merge branch 'upstream' into login-authData-from-prettier
# Conflicts: # integration/test/ParseQueryTest.js # package-lock.json # package.json # src/ParseUser.js # src/__tests__/ParseUser-test.js
2 parents c3fa1e8 + 300caf2 commit b8e68e9

File tree

8 files changed

+1533
-3250
lines changed

8 files changed

+1533
-3250
lines changed

integration/test/ParseLocalDatastoreTest.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2375,22 +2375,6 @@ function runTest(controller) {
23752375
assert(['Billy', 'Tom'].includes(results[1].get('name')));
23762376
});
23772377

2378-
it(`${controller.name} supports objects with length`, async () => {
2379-
const obj = new TestObject();
2380-
obj.set('length', 5);
2381-
assert.equal(obj.get('length'), 5);
2382-
await obj.save();
2383-
await obj.pin();
2384-
2385-
const query = new Parse.Query(TestObject);
2386-
query.equalTo('objectId', obj.id);
2387-
query.fromLocalDatastore();
2388-
const results = await query.find();
2389-
2390-
assert.equal(results.length, 1);
2391-
assert.equal(results[0].get('length'), 5);
2392-
});
2393-
23942378
it(`${controller.name} can include User fields`, async () => {
23952379
const user = await Parse.User.signUp('bob', 'password', { age: 21 });
23962380
const obj = new TestObject();

integration/test/ParseQueryTest.js

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1721,22 +1721,17 @@ describe('Parse Query', () => {
17211721
});
17221722
});
17231723

1724-
it('supports objects with length', done => {
1724+
it('supports objects with length', async done => {
17251725
const obj = new TestObject();
17261726
obj.set('length', 5);
17271727
assert.equal(obj.get('length'), 5);
1728-
obj
1729-
.save()
1730-
.then(() => {
1731-
const query = new Parse.Query(TestObject);
1732-
query.equalTo('objectId', obj.id);
1733-
return query.find();
1734-
})
1735-
.then(results => {
1736-
assert.equal(results.length, 1);
1737-
assert.equal(results[0].get('length'), 5);
1738-
done();
1739-
});
1728+
try {
1729+
await obj.save();
1730+
done.fail();
1731+
} catch (e) {
1732+
assert.strictEqual(e.message, 'Invalid field name: length.');
1733+
done();
1734+
}
17401735
});
17411736

17421737
it('can include User fields', done => {

package-lock.json

Lines changed: 1503 additions & 3200 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,17 @@
6565
"gulp-rename": "2.0.0",
6666
"gulp-uglify": "3.0.2",
6767
"gulp-watch": "5.0.1",
68-
"husky": "^4.3.5",
68+
"husky": "4.3.5",
6969
"jasmine": "3.5.0",
7070
"jasmine-reporters": "2.3.2",
7171
"jest": "24.9.0",
7272
"jsdoc": "3.6.3",
7373
"jsdoc-babel": "0.5.0",
74-
"lint-staged": "^10.5.3",
74+
"lint-staged": "10.5.3",
7575
"metro-react-native-babel-preset": "0.59.0",
7676
"mongodb-runner": "mongodb-js/runner",
7777
"parse-server": "github:parse-community/parse-server#master",
78-
"prettier": "^2.2.1",
78+
"prettier": "2.2.1",
7979
"regenerator-runtime": "0.13.5",
8080
"start-server-and-test": "^1.11.6",
8181
"vinyl-source-stream": "2.0.0"
@@ -100,7 +100,7 @@
100100
"prepare": "npm run build",
101101
"release_docs": "./release_docs.sh",
102102
"gulp": "gulp",
103-
"prettier": "prettier --write {src,integration}/{**/*,*}.js && npm run lint:fix",
103+
"prettier": "prettier --write '{src,integration}/{**/*,*}.js' && npm run lint:fix",
104104
"cross-env": "cross-env"
105105
},
106106
"husky": {
@@ -110,7 +110,8 @@
110110
},
111111
"lint-staged": {
112112
"{src,integration}/{**/*,*}.js": [
113-
"prettier",
113+
"prettier --write",
114+
"eslint --fix --cache",
114115
"git add"
115116
]
116117
},

src/__tests__/test_helpers/asyncHelper.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
// We need this until Jest finishes upgrading to Jasmine 2.0
1111
module.exports = function asyncHelper(fn) {
1212
let finished = false;
13-
const done = function() {
13+
const done = function () {
1414
finished = true;
1515
};
1616

17-
return function() {
18-
runs(function() {
17+
return function () {
18+
runs(function () {
1919
fn(done);
2020
});
2121

22-
waitsFor(function() {
22+
waitsFor(function () {
2323
return finished;
2424
});
2525
};
26-
}
26+
};

src/__tests__/test_helpers/mockRNStorage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ const mockRNStorage = {
2828
},
2929

3030
multiGet(keys, cb) {
31-
const objects = keys.map((key) => [key, mockStorage[key]]);
31+
const objects = keys.map(key => [key, mockStorage[key]]);
3232
cb(undefined, objects);
3333
},
3434

3535
multiRemove(keys, cb) {
36-
keys.map((key) => delete mockStorage[key]);
36+
keys.map(key => delete mockStorage[key]);
3737
cb(undefined);
3838
},
3939

src/__tests__/test_helpers/mockWeChat.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const mockWeChat = {
3030

3131
request(options) {
3232
return {
33-
onProgressUpdate: (cb) => {
33+
onProgressUpdate: cb => {
3434
progressCallback = cb;
3535
},
3636
abort: () => {
@@ -43,8 +43,8 @@ const mockWeChat = {
4343
data: {},
4444
});
4545
options.fail();
46-
}
47-
}
46+
},
47+
};
4848
},
4949

5050
connectSocket() {},

src/__tests__/test_helpers/mockXHR.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,27 @@
1717
* `upload` can be provided to mock the XMLHttpRequest.upload property.
1818
*/
1919
function mockXHR(results, options = {}) {
20-
const XHR = function() { };
20+
const XHR = function () {};
2121
let attempts = 0;
2222
const headers = {};
2323
XHR.prototype = {
24-
open: function() { },
24+
open: function () {},
2525
setRequestHeader: jest.fn((key, value) => {
2626
headers[key] = value;
2727
}),
28-
getRequestHeader: function(key) {
28+
getRequestHeader: function (key) {
2929
return headers[key];
3030
},
31-
upload: function() { },
32-
send: function() {
31+
upload: function () {},
32+
send: function () {
3333
this.status = results[attempts].status;
3434
this.responseText = JSON.stringify(results[attempts].response || {});
3535
this.readyState = 4;
3636
attempts++;
3737
this.onreadystatechange();
3838
this.onprogress(options.progress);
3939
this.upload.onprogress(options.progress);
40-
}
40+
},
4141
};
4242
return XHR;
4343
}

0 commit comments

Comments
 (0)