diff --git a/.eslintrc b/.eslintrc index 0c4c7397..1d9d0aac 100644 --- a/.eslintrc +++ b/.eslintrc @@ -5,7 +5,6 @@ }, "rules": { "quotes": [2, "single"], - "key-spacing": [0], "camelcase": [0], "no-ternary": [2], "valid-jsdoc": [2] diff --git a/lib/services/geocoder.js b/lib/services/geocoder.js index 1e79647a..9c18c3c7 100644 --- a/lib/services/geocoder.js +++ b/lib/services/geocoder.js @@ -18,7 +18,6 @@ var invariant = require('invariant'), function MapboxGeocoder(accessToken) { invariant(typeof accessToken === 'string', 'accessToken required to instantiate MapboxGeocoder'); - console.log('geocoder constructed'); this.accessToken = accessToken; } diff --git a/package.json b/package.json index 9f4af708..e9f6a2c8 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "description": "interface to mapbox services", "main": "lib/client.js", "scripts": { + "lint": "eslint --no-eslintrc -c .eslintrc lib test/*.js", "test": "tap --coverage test/*.js", "docs": "documentation . --format=md > API.md", "build": "browserify -s MapboxClient lib/client.js > dist/mapbox-sdk.js" diff --git a/test/directions.js b/test/directions.js index ff90fdde..e8e2f368 100644 --- a/test/directions.js +++ b/test/directions.js @@ -5,7 +5,7 @@ var test = require('tap').test, // fs = require('fs'), // path = require('path'), geojsonhint = require('geojsonhint'), - MapboxClient = require('../'); + MapboxClient = require('../lib/services/directions'); test('MapboxClient#getDirections', function(t) { t.test('typecheck', function(t) { diff --git a/test/format_points.js b/test/format_points.js new file mode 100644 index 00000000..6f36c3e3 --- /dev/null +++ b/test/format_points.js @@ -0,0 +1,14 @@ +/* eslint no-shadow: 0 */ +'use strict'; + +var test = require('tap').test, + formatPoints = require('../lib/format_points'); + +test('formatPoints', function(t) { + t.throws(function() { + formatPoints([['foo', 'bar']]); + }); + t.equal(formatPoints([{latitude: 0, longitude: 0}]), '0,0'); + t.equal(formatPoints([{latitude: 0, longitude: 0}, {latitude: 0, longitude: 10}]), '0,0;10,0'); + t.end(); +}); diff --git a/test/geocode.js b/test/geocode.js index 71caaa0a..158f1423 100644 --- a/test/geocode.js +++ b/test/geocode.js @@ -5,7 +5,7 @@ var test = require('tap').test, // fs = require('fs'), // path = require('path'), geojsonhint = require('geojsonhint'), - MapboxClient = require('../'); + MapboxClient = require('../lib/services/geocoder'); test('MapboxClient#geocodeForward', function(t) { t.test('typecheck', function(t) { diff --git a/test/make_query.js b/test/make_query.js new file mode 100644 index 00000000..9dde59dc --- /dev/null +++ b/test/make_query.js @@ -0,0 +1,11 @@ +/* eslint no-shadow: 0 */ +'use strict'; + +var test = require('tap').test, + makeQuery = require('../lib/make_query'); + +test('makeQuery', function(t) { + t.equal(makeQuery('test', {}), '?access_token=test'); + t.equal(makeQuery('test', {foo: 1}), '?foo=1&access_token=test'); + t.end(); +}); diff --git a/test/matching.js b/test/matching.js index e2d54ef8..527b92d3 100644 --- a/test/matching.js +++ b/test/matching.js @@ -5,7 +5,7 @@ var test = require('tap').test, // fs = require('fs'), // path = require('path'), geojsonhint = require('geojsonhint'), - MapboxClient = require('../'); + MapboxClient = require('../lib/services/matching'); test('MapboxClient#matching', function(t) { t.test('typecheck', function(t) { diff --git a/test/surface.js b/test/surface.js index 45b8cdaf..afd6fb70 100644 --- a/test/surface.js +++ b/test/surface.js @@ -6,7 +6,7 @@ var test = require('tap').test, // path = require('path'), polyline = require('polyline'), geojsonhint = require('geojsonhint'), - MapboxClient = require('../'); + MapboxClient = require('../lib/services/surface'); test('MapboxClient#surface', function(t) { t.test('typecheck', function(t) {