@@ -6,15 +6,14 @@ let ipinfoWrapper: IPinfoWrapper;
66
77beforeEach ( ( ) => {
88 dotenv . config ( ) ;
9- const token = process . env . IPINFO_TOKEN || "" ;
109
11- if ( ! token ) {
12- throw new Error (
13- "Tests require a token in the IPINFO_TOKEN Environment Variable."
14- ) ;
15- }
16-
17- ipinfoWrapper = new IPinfoWrapper ( token ) ;
10+ ipinfoWrapper = new IPinfoWrapper (
11+ "example-token" ,
12+ undefined ,
13+ undefined ,
14+ { } ,
15+ "http://127.0.0.1:9090"
16+ ) ;
1817} ) ;
1918
2019describe ( "IPinfoWrapper" , ( ) => {
@@ -90,6 +89,10 @@ describe("IPinfoWrapper", () => {
9089 expect ( data . domain ) . toEqual ( "comcast.com" ) ;
9190 expect ( data . num_ips ) . not . toBeFalsy ( ) ;
9291 expect ( data . type ) . toEqual ( "isp" ) ;
92+ expect ( data . prefixes . length ) . toEqual ( 2 ) ;
93+ expect ( data . peers . length ) . toEqual ( 2 ) ;
94+ expect ( data . upstreams . length ) . toEqual ( 2 ) ;
95+ expect ( data . downstreams . length ) . toEqual ( 2 ) ;
9396 }
9497 } ) ;
9598
@@ -121,6 +124,7 @@ describe("IPinfoWrapper", () => {
121124 city : "Weda" ,
122125 region : "North Maluku" ,
123126 country : "Indonesia" ,
127+ countryCode : "ID" ,
124128 loc : "0.3295,127.8739" ,
125129 org : "AS3356 Level 3 Parent, LLC" ,
126130 timezone : "Asia/Jayapura" ,
@@ -147,24 +151,23 @@ describe("IPinfoWrapper", () => {
147151 abuse : {
148152 address : "US, LA, Monroe, 100 CenturyLink Drive, 71203" ,
149153 country : "United States" ,
154+ countryCode : "US" ,
150155151156 name : "L3 Abuse Contact" ,
152157 network : "4.0.0.0/9" ,
153- phone : "+1-877-453-8353" ,
154- countryCode : "US"
158+ phone : "+1-877-453-8353"
155159 } ,
156160 domains : {
157161 ip : "4.4.4.4" ,
158- total : 111 ,
162+ total : 114 ,
159163 domains : [
160164 "itmanagementgroup.de" ,
161165 "safermoto.com" ,
162166 "progeni.com" ,
163167 "grahamhostedservices.com" ,
164168 "bhcentral.tech"
165169 ]
166- } ,
167- countryCode : "ID"
170+ }
168171 } ) ;
169172
170173 expect ( data [ "AS123" ] ) . toEqual ( {
0 commit comments