Skip to content

Commit 7fb7b2d

Browse files
authored
Update tests (#1278)
Bump parse-server to [#43d9af8 ](parse-community/parse-server@43d9af8)
1 parent d40f150 commit 7fb7b2d

File tree

4 files changed

+1461
-1433
lines changed

4 files changed

+1461
-1433
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/ParseObjectTest.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,9 @@ describe('Parse Object', () => {
268268
const startDiff = Math.abs(start.getTime() - object.createdAt.getTime());
269269
const endDiff = Math.abs(end.getTime() - object.createdAt.getTime());
270270
expect(startDiff).toBeLessThan(500);
271-
expect(startDiff).toBeGreaterThan(0);
271+
expect(startDiff).toBeGreaterThanOrEqual(0);
272272
expect(endDiff).toBeLessThan(500);
273-
expect(endDiff).toBeGreaterThan(0);
273+
expect(endDiff).toBeGreaterThanOrEqual(0);
274274
done();
275275
});
276276
});

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 => {

0 commit comments

Comments
 (0)