Skip to content

Commit

Permalink
refactor(test): remove duplicate 2.4 checks re: #5765
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Nov 5, 2017
1 parent 9665a04 commit d284104
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions test/model.geonear.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,13 @@ describe('model', function() {
});

describe('geoNear', function() {
beforeEach(function() {
if (!mongo24_or_greater) {
this.skip();
}
});

it('works with legacy coordinate points', function(done) {
if (!mongo24_or_greater) return done();
var Geo = getModel(db);
assert.ok(Geo.geoNear instanceof Function);

Expand Down Expand Up @@ -107,7 +112,6 @@ describe('model', function() {
});

it('works with GeoJSON coordinate points', function(done) {
if (!mongo24_or_greater) return done();
var Geo = getModel(db);
assert.ok(Geo.geoNear instanceof Function);

Expand Down Expand Up @@ -157,7 +161,6 @@ describe('model', function() {
});

it('works with lean', function(done) {
if (!mongo24_or_greater) return done();
var Geo = getModel(db);
assert.ok(Geo.geoNear instanceof Function);

Expand Down Expand Up @@ -207,8 +210,6 @@ describe('model', function() {
});

it('throws the correct error messages', function(done) {
if (!mongo24_or_greater) return done();

var Geo = getModel(db);

Geo.init().then(function() {
Expand Down Expand Up @@ -240,7 +241,6 @@ describe('model', function() {
});

it('returns a promise (gh-1614)', function(done) {
if (!mongo24_or_greater) return done();
var Geo = getModel(db);

var pnt = {type: 'Point', coordinates: testLocations.PORT_AUTHORITY_STATION};
Expand All @@ -251,7 +251,6 @@ describe('model', function() {
});

it('allows not passing a callback (gh-1614)', function(done) {
if (!mongo24_or_greater) return done();
var Geo = getModel(db);
Geo.init().then(function() {
var g = new Geo({coordinates: testLocations.MONGODB_NYC_OFFICE, type: 'Point'});
Expand Down Expand Up @@ -281,7 +280,6 @@ describe('model', function() {
});

it('promise fulfill even when no results returned', function(done) {
if (!mongo24_or_greater) return done();
var Geo = getModel(db);
Geo.init().then(function() {
var g = new Geo({coordinates: [1, 1], type: 'Point'});
Expand All @@ -304,7 +302,6 @@ describe('model', function() {
});

it('casts (gh-5765)', function(done) {
if (!mongo24_or_greater) return done();
var Geo = getModel(db);
Geo.init().then(function() {
var g = new Geo({coordinates: [1, 1], type: 'Point', priority: 1});
Expand Down

0 comments on commit d284104

Please sign in to comment.