File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 11const assert = require ( 'assert' ) ;
2+ const path = require ( 'path' ) ;
23const fs = require ( 'fs' ) ;
34const geolite2 = require ( '../' ) ;
45const rimraf = require ( 'rimraf' ) ;
56const 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 } ) ;
You can’t perform that action at this time.
0 commit comments