@@ -256,12 +256,16 @@ describe("options.resolve", () => {
256
256
it ( "should block unsafe URLs when safeUrlResolver is true (default)" , async ( ) => {
257
257
const unsafeUrls = [
258
258
"http://localhost/schema.json" ,
259
- "http://127.0.0.1/schema.json" ,
259
+ "http://127.0.0.1/schema.json" ,
260
260
"http://192.168.1.1/schema.json" ,
261
261
"http://10.0.0.1/schema.json" ,
262
262
"http://172.16.0.1/schema.json" ,
263
263
] ;
264
264
265
+ // if we're in the browser, skip the test
266
+ if ( typeof window !== "undefined" ) {
267
+ return ;
268
+ }
265
269
for ( const unsafeUrl of unsafeUrls ) {
266
270
try {
267
271
await $RefParser . dereference ( { $ref : unsafeUrl } ) ;
@@ -283,14 +287,11 @@ describe("options.resolve", () => {
283
287
} ,
284
288
} ;
285
289
286
- const schema = await $RefParser . dereference (
287
- { $ref : "http://localhost/schema.json" } ,
288
- {
289
- resolve : {
290
- http : mockHttpResolver ,
291
- } ,
292
- } as ParserOptions ,
293
- ) ;
290
+ const schema = await $RefParser . dereference ( { $ref : "http://localhost/schema.json" } , {
291
+ resolve : {
292
+ http : mockHttpResolver ,
293
+ } ,
294
+ } as ParserOptions ) ;
294
295
295
296
expect ( schema ) . to . deep . equal ( {
296
297
type : "object" ,
0 commit comments