@@ -129,19 +129,19 @@ let ipv4Expected = {
129
129
country_code : "GB" ,
130
130
country_code3 : "GBR" ,
131
131
country_name : "united kingdom" ,
132
- gmt_offset : 0 ,
133
132
latitude : 53.42 ,
134
133
longitude : - 1.05 ,
135
134
metro_code : 826039 ,
136
135
postal_code : "dn11 8af" ,
137
136
proxy_description : "?" ,
138
137
proxy_type : "?" ,
139
138
region : "NTT" ,
140
- utc_offset : 0
141
139
}
142
140
143
141
routes . set ( "/fastly/getgeolocationforipaddress/parameter-ipv4-string" , async ( ) => {
144
142
let geo = fastly . getGeolocationForIpAddress ( '2.216.196.179' )
143
+ delete geo . utc_offset ;
144
+ delete geo . gmt_offset ;
145
145
let error = assert ( geo , ipv4Expected , `fastly.getGeolocationForIpAddress('2.216.196.179') == ipv4Expected` )
146
146
if ( error ) { return error }
147
147
return pass ( )
@@ -158,45 +158,52 @@ let expected = {
158
158
country_code : "US" ,
159
159
country_code3 : "USA" ,
160
160
country_name : "united states" ,
161
- gmt_offset : - 600 ,
162
161
latitude : 32.94 ,
163
162
longitude : - 96.84 ,
164
163
metro_code : 623 ,
165
164
postal_code : "75244" ,
166
165
proxy_description : "?" ,
167
166
proxy_type : "hosting" ,
168
167
region : "TX" ,
169
- utc_offset : - 600
170
168
}
171
169
routes . set ( "/fastly/getgeolocationforipaddress/parameter-compressed-ipv6-string" , async ( ) => {
172
170
let geo = fastly . getGeolocationForIpAddress ( '2607:f0d0:1002:51::4' )
173
- console . log ( { geo } )
171
+ delete geo . utc_offset ;
172
+ delete geo . gmt_offset ;
174
173
let error = assert ( geo , expected , `fastly.getGeolocationForIpAddress('2607:f0d0:1002:51::4') == expected` )
175
174
if ( error ) { return error }
176
175
return pass ( )
177
176
} ) ;
178
177
routes . set ( "/fastly/getgeolocationforipaddress/parameter-shortened-ipv6-string" , async ( ) => {
179
178
let geo = fastly . getGeolocationForIpAddress ( '2607:f0d0:1002:0051:0:0:0:0004' )
179
+ delete geo . utc_offset ;
180
+ delete geo . gmt_offset ;
180
181
let error = assert ( geo , expected , `fastly.getGeolocationForIpAddress('2607:f0d0:1002:0051:0:0:0:0004') == expected` )
181
182
if ( error ) { return error }
182
183
return pass ( )
183
184
} ) ;
184
185
routes . set ( "/fastly/getgeolocationforipaddress/parameter-expanded-ipv6-string" , async ( ) => {
185
186
let geo = fastly . getGeolocationForIpAddress ( '2607:f0d0:1002:0051:0000:0000:0000:0004' )
187
+ delete geo . utc_offset ;
188
+ delete geo . gmt_offset ;
186
189
let error = assert ( geo , expected , `fastly.getGeolocationForIpAddress('2607:f0d0:1002:0051:0000:0000:0000:0004') == expected` )
187
190
if ( error ) { return error }
188
191
return pass ( )
189
192
} ) ;
190
193
// TODO: Uncomment these tests once IPv4-in-6 is working in ipll
191
194
// routes.set("/fastly/getgeolocationforipaddress/parameter-dual-ipv4-ipv6-string", async () => {
192
195
// let geo = fastly.getGeolocationForIpAddress('::FFFF:2.216.196.179')
196
+ // delete geo.utc_offset;
197
+ // delete geo.gmt_offset;
193
198
// let error = assert(geo, expected, `fastly.getGeolocationForIpAddress('::2.216.196.179') == expected`)
194
199
// if (error) { return error }
195
200
// return pass()
196
201
// });
197
202
198
203
routes . set ( "/fastly/getgeolocationforipaddress/called-unbound" , async ( ) => {
199
204
let geo = fastly . getGeolocationForIpAddress . call ( undefined , '2607:f0d0:1002:0051:0000:0000:0000:0004' )
205
+ delete geo . utc_offset ;
206
+ delete geo . gmt_offset ;
200
207
let error = assert ( geo , expected , `fastly.getGeolocationForIpAddress.call(undefined, '2607:f0d0:1002:0051:0000:0000:0000:0004') == expected` )
201
208
if ( error ) { return error }
202
209
return pass ( )
0 commit comments