diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..c7e587f --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,6 @@ +{ + "extends": "eslint:recommended", + "env": { + "node": true + } +} diff --git a/.travis.yml b/.travis.yml index 4986d24..7def279 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,13 +12,13 @@ addons: matrix: include: - os: linux - env: NODE_VERSION="4" COVERAGE=true + env: NODE_VERSION="8" - os: linux - env: NODE_VERSION="6" + env: NODE_VERSION="10" COVERAGE=true - os: osx - env: NODE_VERSION="4" + env: NODE_VERSION="8" - os: osx - env: NODE_VERSION="6" + env: NODE_VERSION="10" before_install: - rm -rf ~/.nvm/ && git clone --depth 1 https://github.com/creationix/nvm.git ~/.nvm diff --git a/package.json b/package.json index 1dab7ca..b5e4669 100644 --- a/package.json +++ b/package.json @@ -9,28 +9,29 @@ "geodata" ], "dependencies": { - "@mapbox/sphericalmercator": "~1.0.5", "@mapbox/mapbox-file-sniff": "~1.0.0", - "srs": "~1.2.0", - "mapnik": "~3.7.0", + "@mapbox/sphericalmercator": "~1.0.5", "gdal": "~0.9.3", - "queue-async": "~1.2.0" + "mapnik": "~4.2.1", + "queue-async": "~1.2.0", + "srs": "~1.2.0" }, "repository": { "type": "git", "url": "https://github.com/mapbox/mapnik-omnivore" }, "devDependencies": { - "coveralls": "~2.11.1", - "istanbul": "~0.3.0", - "jscs": "^1.10.0", - "jshint": "^2.6.0", + "coveralls": "^3.0.2", + "nyc": "^13.3.0", + "eslint": "^5.13.0", + "eslint-config-airbnb-base": "^13.1.0", + "eslint-plugin-import": "^2.16.0", "mapnik-test-data": "https://mapbox-npm.s3.amazonaws.com/package/mapnik-test-data-2.0.5-c84800ed20a6a9bc2143dd11b1b2a3190b9ae698.tgz", - "tape": "3.0.x" + "tape": "^4.10.1" }, "scripts": { - "test": "jshint index.js test lib && jscs index.js test lib && tape test/*.js", - "coverage": "istanbul cover tape test/*.test.js && coveralls < ./coverage/lcov.info" + "test": "eslint index.js test lib && tape test/*.js", + "coverage": "nyc npm test && nyc report --reporter=text-lcov | coveralls" }, "bin": { "digest": "bin/digest" diff --git a/test/fixtures/metadata_contours.json b/test/fixtures/metadata_contours.json index 697d045..e1d1495 100644 --- a/test/fixtures/metadata_contours.json +++ b/test/fixtures/metadata_contours.json @@ -5,12 +5,12 @@ "filesize": 24576628, "center": [ -122.31742219942615, - 37.87235316048361 + 37.87235316048363 ], "extent": [ -122.31849442745843, - 37.871487370753606, - -122.31634997139385, + 37.871487370753634, + -122.31634997139386, 37.87321895021363 ], "minzoom": 19, diff --git a/test/index.test.js b/test/index.test.js index 0203deb..d23ec19 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -93,7 +93,7 @@ tape('[GeoJson] digest function should return expected metadata', function(asser tape('[GeoJson] digest function should error and return sanitized message', function(assert) { var fixture = path.resolve(__dirname, 'fixtures', 'parse.error.json'); - var expectedError = 'Invalid geojson: does not contain any features'; + var expectedError = 'Error creating Mapnik Datasource: Invalid geojson'; mapnik_omnivore.digest(fixture, function(err) { assert.ok(err, 'expected error'); assert.deepEqual(err.message, expectedError, 'expected error message');