@@ -73,11 +73,11 @@ describe("Invalid syntax", () => {
73
73
}
74
74
} ) ;
75
75
76
- describe ( "when failFast is false " , ( ) => {
76
+ describe ( "when continueOnError is true " , ( ) => {
77
77
it ( "should throw a grouped error for an invalid file path" , async ( ) => {
78
78
const parser = new $RefParser ( ) ;
79
79
try {
80
- await parser . dereference ( "this file does not exist" , { failFast : false } ) ;
80
+ await parser . dereference ( "this file does not exist" , { continueOnError : true } ) ;
81
81
helper . shouldNotGetCalled ( ) ;
82
82
}
83
83
catch ( err ) {
@@ -100,7 +100,7 @@ describe("Invalid syntax", () => {
100
100
it ( "should throw a grouped error for an invalid YAML file" , async ( ) => {
101
101
const parser = new $RefParser ( ) ;
102
102
try {
103
- await parser . dereference ( path . rel ( "specs/invalid/invalid.yaml" ) , { failFast : false } ) ;
103
+ await parser . dereference ( path . rel ( "specs/invalid/invalid.yaml" ) , { continueOnError : true } ) ;
104
104
helper . shouldNotGetCalled ( ) ;
105
105
}
106
106
catch ( err ) {
@@ -122,7 +122,7 @@ describe("Invalid syntax", () => {
122
122
it ( "should throw a grouped error for an invalid JSON file" , async ( ) => {
123
123
const parser = new $RefParser ( ) ;
124
124
try {
125
- await parser . dereference ( path . rel ( "specs/invalid/invalid.json" ) , { failFast : false } ) ;
125
+ await parser . dereference ( path . rel ( "specs/invalid/invalid.json" ) , { continueOnError : true } ) ;
126
126
helper . shouldNotGetCalled ( ) ;
127
127
}
128
128
catch ( err ) {
@@ -144,7 +144,7 @@ describe("Invalid syntax", () => {
144
144
it ( "should throw a grouped error for an invalid JSON file with YAML disabled" , async ( ) => {
145
145
const parser = new $RefParser ( ) ;
146
146
try {
147
- await parser . dereference ( path . rel ( "specs/invalid/invalid.json" ) , { failFast : false , parse : { yaml : false } } ) ;
147
+ await parser . dereference ( path . rel ( "specs/invalid/invalid.json" ) , { continueOnError : true , parse : { yaml : false } } ) ;
148
148
helper . shouldNotGetCalled ( ) ;
149
149
}
150
150
catch ( err ) {
@@ -165,7 +165,7 @@ describe("Invalid syntax", () => {
165
165
166
166
it ( "should not throw an error for an invalid YAML file with JSON and YAML disabled" , async ( ) => {
167
167
const parser = new $RefParser ( ) ;
168
- const result = await parser . dereference ( path . rel ( "specs/invalid/invalid.yaml" ) , { failFast : false , parse : { yaml : false , json : false } } ) ;
168
+ const result = await parser . dereference ( path . rel ( "specs/invalid/invalid.yaml" ) , { continueOnError : true , parse : { yaml : false , json : false } } ) ;
169
169
expect ( result ) . to . be . null ;
170
170
} ) ;
171
171
} ) ;
@@ -222,11 +222,11 @@ describe("Invalid syntax", () => {
222
222
} ) ;
223
223
} ) ;
224
224
225
- describe ( "when failFast is false " , ( ) => {
225
+ describe ( "when continueOnError is true " , ( ) => {
226
226
it ( "should throw a grouped error for an invalid file path" , async ( ) => {
227
227
try {
228
228
const parser = new $RefParser ( ) ;
229
- await parser . dereference ( { foo : { $ref : "this file does not exist" } } , { failFast : false } ) ;
229
+ await parser . dereference ( { foo : { $ref : "this file does not exist" } } , { continueOnError : true } ) ;
230
230
helper . shouldNotGetCalled ( ) ;
231
231
}
232
232
catch ( err ) {
@@ -247,7 +247,7 @@ describe("Invalid syntax", () => {
247
247
it ( "should throw a grouped error for an invalid YAML file" , async ( ) => {
248
248
try {
249
249
const parser = new $RefParser ( ) ;
250
- await parser . dereference ( { foo : { $ref : path . rel ( "specs/invalid/invalid.yaml" ) } } , { failFast : false } ) ;
250
+ await parser . dereference ( { foo : { $ref : path . rel ( "specs/invalid/invalid.yaml" ) } } , { continueOnError : true } ) ;
251
251
helper . shouldNotGetCalled ( ) ;
252
252
}
253
253
catch ( err ) {
@@ -268,7 +268,7 @@ describe("Invalid syntax", () => {
268
268
it ( "should throw a grouped error for an invalid JSON file" , async ( ) => {
269
269
try {
270
270
const parser = new $RefParser ( ) ;
271
- await parser . dereference ( { foo : { $ref : path . rel ( "specs/invalid/invalid.json" ) } } , { failFast : false } ) ;
271
+ await parser . dereference ( { foo : { $ref : path . rel ( "specs/invalid/invalid.json" ) } } , { continueOnError : true } ) ;
272
272
helper . shouldNotGetCalled ( ) ;
273
273
}
274
274
catch ( err ) {
@@ -289,7 +289,7 @@ describe("Invalid syntax", () => {
289
289
it ( "should throw a grouped error for an invalid JSON file with YAML disabled" , async ( ) => {
290
290
try {
291
291
const parser = new $RefParser ( ) ;
292
- await parser . dereference ( { foo : { $ref : path . rel ( "specs/invalid/invalid.json" ) } } , { failFast : false , parse : { yaml : false } } ) ;
292
+ await parser . dereference ( { foo : { $ref : path . rel ( "specs/invalid/invalid.json" ) } } , { continueOnError : true , parse : { yaml : false } } ) ;
293
293
helper . shouldNotGetCalled ( ) ;
294
294
}
295
295
catch ( err ) {
@@ -309,7 +309,7 @@ describe("Invalid syntax", () => {
309
309
310
310
it ( "should not throw an error for an invalid YAML file with JSON and YAML disabled" , async ( ) => {
311
311
const parser = new $RefParser ( ) ;
312
- const result = await parser . dereference ( { foo : { $ref : path . rel ( "specs/invalid/invalid.yaml" ) } } , { failFast : false , parse : { yaml : false , json : false } } ) ;
312
+ const result = await parser . dereference ( { foo : { $ref : path . rel ( "specs/invalid/invalid.yaml" ) } } , { continueOnError : true , parse : { yaml : false , json : false } } ) ;
313
313
expect ( result ) . to . deep . equal ( { foo : ":\n" } ) ;
314
314
} ) ;
315
315
} ) ;
0 commit comments