Skip to content

Commit

Permalink
Re-enable and slightly rewrite flaky GeoPoint test.
Browse files Browse the repository at this point in the history
  • Loading branch information
nlutsenko committed Feb 23, 2016
1 parent 1f40c0a commit 34e97b1
Showing 1 changed file with 26 additions and 29 deletions.
55 changes: 26 additions & 29 deletions spec/ParseGeoPoint.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,37 +39,34 @@ describe('Parse.GeoPoint testing', () => {
});
});

//

// This test is disabled, since it's extremely flaky on Travis-CI.
// Tracking issue: https://github.com/ParsePlatform/parse-server/issues/572
//
// it('geo line', (done) => {
// var line = [];
// for (var i = 0; i < 10; ++i) {
// var obj = new TestObject();
// var point = new Parse.GeoPoint(i * 4.0 - 12.0, i * 3.2 - 11.0);
// obj.set('location', point);
// obj.set('construct', 'line');
// obj.set('seq', i);
// line.push(obj);
// }
// Parse.Object.saveAll(line, {
// success: function() {
// var query = new Parse.Query(TestObject);
// var point = new Parse.GeoPoint(24, 19);
// query.equalTo('construct', 'line');
// query.withinMiles('location', point, 10000);
// query.find({
// success: function(results) {
// equal(results.length, 10);
// equal(results[0].get('seq'), 9);
// equal(results[3].get('seq'), 6);
// done();
// }
// });
// }
// });
// });
it('geo line', (done) => {
var line = [];
for (var i = 0; i < 10; ++i) {
var obj = new TestObject();
var point = new Parse.GeoPoint(i * 4.0 - 12.0, i * 3.2 - 11.0);
obj.set('location', point);
obj.set('construct', 'line');
obj.set('seq', i);
line.push(obj);
}
Parse.Object.saveAll(line).then(() => {
var query = new Parse.Query(TestObject);
var point = new Parse.GeoPoint(24, 19);
query.equalTo('construct', 'line');
query.withinMiles('location', point, 10000);
return query.find();
}).then((results) => {
equal(results.length, 10);
equal(results[0].get('seq'), 9);
equal(results[3].get('seq'), 6);
done();
}, (err) => {
fail('failed with ', err);
});
}, 10000);

it('geo max distance large', (done) => {
var objects = [];
Expand Down

0 comments on commit 34e97b1

Please sign in to comment.