Skip to content

Commit a6d36ae

Browse files
committed
chore: update tests
1 parent 62af1ed commit a6d36ae

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

test/index.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,33 @@
11
const assert = require('assert');
2+
const path = require('path');
23
const fs = require('fs');
34
const geolite2 = require('../');
45
const rimraf = require('rimraf');
56
const maxmind = require('maxmind');
67

7-
describe('geolite2', function() {
8+
describe('geolite2', async function() {
9+
const paths = {
10+
'GeoLite2-ASN': path.resolve('../dbs/GeoLite2-ASN.mmdb'),
11+
'GeoLite2-Country': path.resolve('../dbs/GeoLite2-Country.mmdb'),
12+
'GeoLite2-City': path.resolve('../dbs/GeoLite2-City.mmdb')
13+
};
14+
15+
await geolite2.downloadDbs()
16+
817
it('should contain a valid ASN db', function() {
9-
let stat = fs.statSync(geolite2.paths['GeoLite2-ASN']);
18+
let stat = fs.statSync(paths['GeoLite2-ASN']);
1019
assert(stat.size > 1e6);
1120
assert(stat.ctime);
1221
});
1322

1423
it('should contain a valid country db', function() {
15-
let stat = fs.statSync(geolite2.paths['GeoLite2-Country']);
24+
let stat = fs.statSync(paths['GeoLite2-Country']);
1625
assert(stat.size > 1e6);
1726
assert(stat.ctime);
1827
});
1928

2029
it('should contain a valid city db', function() {
21-
let stat = fs.statSync(geolite2.paths['GeoLite2-City']);
30+
let stat = fs.statSync(paths['GeoLite2-City']);
2231
assert(stat.size > 1e6);
2332
assert(stat.ctime);
2433
});

0 commit comments

Comments
 (0)