@@ -82,9 +82,9 @@ describe("Invalid syntax", () => {
82
82
expect ( parser . errors ) . to . containSubset ( [
83
83
{
84
84
name : ResolverError . name ,
85
- message : expectedValue => expectedValue . startsWith ( "Error opening file" ) ,
85
+ message : expectedValue => expectedValue . startsWith ( "Error opening file" ) || expectedValue . endsWith ( "HTTP ERROR 404" ) ,
86
86
path : [ ] ,
87
- source : expectedValue => expectedValue . endsWith ( "/test/ this file does not exist" ) ,
87
+ source : expectedValue => expectedValue . endsWith ( "this file does not exist" ) || expectedValue . startsWith ( "http://localhost ") ,
88
88
}
89
89
] ) ;
90
90
} ) ;
@@ -198,13 +198,14 @@ describe("Invalid syntax", () => {
198
198
it ( "should not throw an error for an invalid file path" , async ( ) => {
199
199
const parser = new $RefParser ( ) ;
200
200
const result = await parser . dereference ( { foo : { $ref : "this file does not exist" } } , { failFast : false } ) ;
201
+ expect ( result ) . to . deep . equal ( { foo : null } ) ;
201
202
expect ( parser . errors . length ) . to . equal ( 1 ) ;
202
203
expect ( parser . errors ) . to . containSubset ( [
203
204
{
204
205
name : ResolverError . name ,
205
- message : expectedValue => expectedValue . startsWith ( "Error opening file" ) ,
206
+ message : expectedValue => expectedValue . startsWith ( "Error opening file" ) || expectedValue . endsWith ( "HTTP ERROR 404" ) ,
206
207
path : [ "foo" ] ,
207
- source : expectedValue => expectedValue . endsWith ( "/test/" ) ,
208
+ source : expectedValue => expectedValue . endsWith ( "/test/" ) || expectedValue . startsWith ( "http://localhost" ) ,
208
209
}
209
210
] ) ;
210
211
} ) ;
@@ -219,7 +220,7 @@ describe("Invalid syntax", () => {
219
220
name : ParserError . name ,
220
221
message : "incomplete explicit mapping pair; a key node is missed" ,
221
222
path : [ "foo" ] ,
222
- source : expectedValue => expectedValue . endsWith ( "/test/" ) ,
223
+ source : expectedValue => expectedValue . endsWith ( "/test/" ) || expectedValue . startsWith ( "http://localhost" ) ,
223
224
} ,
224
225
] ) ;
225
226
} ) ;
@@ -234,7 +235,7 @@ describe("Invalid syntax", () => {
234
235
name : ParserError . name ,
235
236
message : "unexpected end of the stream within a flow collection" ,
236
237
path : [ "foo" ] ,
237
- source : expectedValue => expectedValue . endsWith ( "/test/" ) ,
238
+ source : expectedValue => expectedValue . endsWith ( "/test/" ) || expectedValue . startsWith ( "http://localhost" ) ,
238
239
}
239
240
] ) ;
240
241
} ) ;
@@ -249,7 +250,7 @@ describe("Invalid syntax", () => {
249
250
name : ParserError . name ,
250
251
message : "CloseBraceExpected" ,
251
252
path : [ "foo" ] ,
252
- source : expectedValue => expectedValue . endsWith ( "/test/" ) ,
253
+ source : expectedValue => expectedValue . endsWith ( "/test/" ) || expectedValue . startsWith ( "http://localhost" ) ,
253
254
}
254
255
] ) ;
255
256
} ) ;
0 commit comments