Skip to content

Commit

Permalink
deps: pin versions, test update
Browse files Browse the repository at this point in the history
  • Loading branch information
msimerson committed Apr 3, 2024
1 parent 4b0fc29 commit 5314321
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .codeclimate.yml
@@ -1,7 +1,7 @@
engines:
eslint:
enabled: true
channel: "eslint-6"
channel: "eslint-8"
config:
config: ".eslintrc.yaml"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Expand Up @@ -3,7 +3,7 @@ name: publish
on:
push:
branches:
- master
- geoip-lite
paths:
- package.json

Expand Down
14 changes: 6 additions & 8 deletions package.json
Expand Up @@ -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"
Expand All @@ -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"
}
}
8 changes: 4 additions & 4 deletions test/geoip.js
Expand Up @@ -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();
Expand All @@ -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);
Expand Down

0 comments on commit 5314321

Please sign in to comment.