diff --git a/.codeclimate.yml b/.codeclimate.yml index 63e64e4..86ec8ee 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -1,7 +1,7 @@ engines: eslint: enabled: true - channel: "eslint-6" + channel: "eslint-8" config: config: ".eslintrc.yaml" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d489fbd..0523187 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,7 +3,7 @@ name: publish on: push: branches: - - master + - geoip-lite paths: - package.json diff --git a/package.json b/package.json index cf2081c..813a14a 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "test": "test" }, "scripts": { - "test": "npx mocha --exit", - "lint": "npx eslint index.js test/*.js", + "test": "npx mocha@^10", + "lint": "npx eslint@^8 index.js test/*.js", "lintfix": "npx eslint --fix index.js test/*.js", "cover": "NODE_ENV=cov npx nyc --reporter=lcovonly npm run test", "versions": "npx dependency-version-checker check" @@ -31,13 +31,11 @@ }, "homepage": "https://github.com/haraka/haraka-plugin-geoip#readme", "devDependencies": { - "eslint": "*", - "eslint-plugin-haraka": "*", - "haraka-test-fixtures": "*", - "mocha": "*" + "eslint-plugin-haraka": "^1.0.15", + "haraka-test-fixtures": "^1.3.3" }, "dependencies": { - "geoip-lite": "*", - "haraka-net-utils": "*" + "geoip-lite": "^1.4.10", + "haraka-net-utils": "^1.5.4" } } diff --git a/test/geoip.js b/test/geoip.js index 9cb660f..dcd576d 100644 --- a/test/geoip.js +++ b/test/geoip.js @@ -99,11 +99,11 @@ describe('database lookups', function () { }) it('michigan: lat + long', function (done) { - this.connection.remote.ip='199.176.179.3'; + this.connection.remote.ip='24.204.186.246'; this.plugin.lookup((rc) => { const r = this.connection.results.get('geoip'); - assert.equal(44.2504, r.ll[0]); - assert.equal(-85.43, r.ll[1]); + assert.equal(Math.floor(r.ll[0]), 44); + assert.equal(Math.floor(r.ll[1]), -86); assert.equal('US', r.country); if (r.continent) assert.equal('NA', r.continent); done(); @@ -119,7 +119,7 @@ describe('database lookups', function () { this.plugin.cfg.main.calc_distance=true; this.plugin.local_ip='192.48.85.146'; - this.connection.remote.ip='199.176.179.3'; + this.connection.remote.ip='24.204.186.246'; delete this.plugin.local_geoip; this.plugin.calculate_distance(this.connection, [38, -97], (err, d) => { if (err) console.error(err);