diff --git a/query/reverse.js b/query/reverse.js index f91561aa..be024072 100644 --- a/query/reverse.js +++ b/query/reverse.js @@ -1,4 +1,3 @@ - var peliasQuery = require('pelias-query'), defaults = require('./defaults'); diff --git a/query/search.js b/query/search.js index bc88516f..0884298d 100644 --- a/query/search.js +++ b/query/search.js @@ -1,4 +1,3 @@ - var peliasQuery = require('pelias-query'), defaults = require('./defaults'), textParser = require('./text_parser'); diff --git a/sanitiser/_geo_search.js b/sanitiser/_geo_search.js index cc2fafcb..237555b4 100644 --- a/sanitiser/_geo_search.js +++ b/sanitiser/_geo_search.js @@ -1,4 +1,3 @@ - var geo_common = require ('./_geo_common'); var LAT_LON_IS_REQUIRED = false; diff --git a/sanitiser/_text.js b/sanitiser/_text.js index 2f1f96af..5df79225 100644 --- a/sanitiser/_text.js +++ b/sanitiser/_text.js @@ -1,4 +1,3 @@ - var check = require('check-types'), query_parser = require('../helper/query_parser'); diff --git a/test/unit/query/reverse.js b/test/unit/query/reverse.js index 0d37fd1c..bb838626 100644 --- a/test/unit/query/reverse.js +++ b/test/unit/query/reverse.js @@ -21,6 +21,7 @@ module.exports.tests.query = function(test, common) { t.deepEqual(compiled, expected, 'valid reverse query'); t.end(); }); + test('valid query with radius', function(t) { var query = generate({ lat: 29.49136, lon: -82.50622, boundary_circle_radius: 123 @@ -32,6 +33,7 @@ module.exports.tests.query = function(test, common) { t.deepEqual(compiled, expected, 'distance set to boundary circle radius'); t.end(); }); + test('valid query with boundary.circle lat/lon/radius', function(t) { var clean = { lat: 29.49136, @@ -47,6 +49,7 @@ module.exports.tests.query = function(test, common) { t.deepEqual(compiled, expected, 'point.lat/lon overrides boundary.circle.lat/lon'); t.end(); }); + test('size fuzz test', function(t) { // test different sizes var sizes = [1,2,10,undefined,null]; @@ -73,7 +76,6 @@ module.exports.tests.query = function(test, common) { t.deepEqual(compiled, expected, 'valid reverse query with boundary.country'); t.end(); }); - }; module.exports.all = function (tape, common) { diff --git a/test/unit/sanitiser/_geo_common.js b/test/unit/sanitiser/_geo_common.js index 9c3d5b3f..dc5b4823 100644 --- a/test/unit/sanitiser/_geo_common.js +++ b/test/unit/sanitiser/_geo_common.js @@ -21,7 +21,7 @@ module.exports.tests.sanitize = function(test, common) { }; var is_required = true; var all_required = true; - + sanitize.sanitize_boundary_circle(clean, params, is_required, all_required); t.equal(clean.boundary_circle_lat, params['boundary.circle.lat'], 'lat approved'); t.equal(clean.boundary_circle_lon, params['boundary.circle.lon'], 'lon approved'); diff --git a/test/unit/sanitiser/search.js b/test/unit/sanitiser/search.js index 5992f94e..e6aee6ac 100644 --- a/test/unit/sanitiser/search.js +++ b/test/unit/sanitiser/search.js @@ -1,4 +1,3 @@ - var search = require('../../../sanitiser/search'), _text = require('../sanitiser/_text'), parser = require('../../../helper/query_parser'),