Skip to content

Commit c18bf7b

Browse files
committed
Make test code much simpler
1 parent 7f75711 commit c18bf7b

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

spec/ParseQuery.spec.js

+12-15
Original file line numberDiff line numberDiff line change
@@ -4542,26 +4542,23 @@ describe('Parse.Query testing', () => {
45424542
.catch(() => done());
45434543
});
45444544

4545-
it('geo query supports count', done => {
4545+
it('geo query supports count', async () => {
45464546
const inside = new Parse.GeoPoint(0, 0);
45474547
const outside = new Parse.GeoPoint(20, 20);
4548+
45484549
const obj1 = new Parse.Object('TestObject', { location: inside });
45494550
const obj2 = new Parse.Object('TestObject', { location: outside });
45504551

4551-
const center = new Parse.GeoPoint(0, 0);
4552-
Parse.Object.saveAll([obj1, obj2])
4553-
.then(() => {
4554-
const q = new Parse.Query(TestObject).withinKilometers("location", new Parse.GeoPoint(0,0), 20);
4555-
return q.count();
4556-
})
4557-
.then(count => {
4558-
equal(count, 1);
4559-
done();
4560-
})
4561-
.catch(error => {
4562-
fail(error);
4563-
done();
4564-
});
4552+
await Parse.Object.saveAll([obj1, obj2]);
4553+
4554+
const q = new Parse.Query(TestObject).withinKilometers(
4555+
'location',
4556+
inside,
4557+
20
4558+
);
4559+
const count = await q.count();
4560+
4561+
equal(count, 1);
45654562
});
45664563

45674564
it('can add new config to existing config', async () => {

0 commit comments

Comments
 (0)