@@ -340,23 +340,23 @@ describe('API Types', () => {
340
340
describe ( 'CsvError' , ( ) => {
341
341
describe ( 'Typescript definition is accurate' , ( ) => {
342
342
it ( 'Minimum' , ( ) => {
343
- const error = new CsvError ( "CSV_INCONSISTENT_RECORD_LENGTH " , "MESSAGE" ) ;
343
+ const error = new CsvError ( "CSV_RECORD_INCONSISTENT_FIELDS_LENGTH " , "MESSAGE" ) ;
344
344
345
- error . code . should . eql ( "CSV_INCONSISTENT_RECORD_LENGTH " )
345
+ error . code . should . eql ( "CSV_RECORD_INCONSISTENT_FIELDS_LENGTH " )
346
346
error . message . should . eql ( "MESSAGE" )
347
347
} )
348
348
349
349
it ( 'Multiple messages' , ( ) => {
350
- const error = new CsvError ( "CSV_INCONSISTENT_RECORD_LENGTH " , [ "MESSAGE1" , "MESSAGE2" ] )
350
+ const error = new CsvError ( "CSV_RECORD_INCONSISTENT_FIELDS_LENGTH " , [ "MESSAGE1" , "MESSAGE2" ] )
351
351
352
- error . code . should . eql ( "CSV_INCONSISTENT_RECORD_LENGTH " )
352
+ error . code . should . eql ( "CSV_RECORD_INCONSISTENT_FIELDS_LENGTH " )
353
353
error . message . should . eql ( "MESSAGE1 MESSAGE2" )
354
354
} )
355
355
356
356
it ( 'Supports contexts' , ( ) => {
357
- const error = new CsvError ( "CSV_INCONSISTENT_RECORD_LENGTH " , "MESSAGE" , { } , { testContext : { testProp : "testValue" } } )
357
+ const error = new CsvError ( "CSV_RECORD_INCONSISTENT_FIELDS_LENGTH " , "MESSAGE" , { } , { testContext : { testProp : "testValue" } } )
358
358
359
- error . code . should . eql ( "CSV_INCONSISTENT_RECORD_LENGTH " )
359
+ error . code . should . eql ( "CSV_RECORD_INCONSISTENT_FIELDS_LENGTH " )
360
360
error . message . should . eql ( "MESSAGE" )
361
361
error . should . have . key ( "testContext" ) . and . eql ( { testProp : "testValue" } )
362
362
} )
@@ -366,7 +366,7 @@ describe('API Types', () => {
366
366
parse ( `a,b\nc` , function ( e : Error | undefined ) {
367
367
const isCsvError = e instanceof CsvError ;
368
368
isCsvError . should . be . true ( ) ;
369
- ( e as CsvError ) . code . should . eql ( 'CSV_INCONSISTENT_RECORD_LENGTH ' ) ;
369
+ ( e as CsvError ) . code . should . eql ( 'CSV_RECORD_INCONSISTENT_FIELDS_LENGTH ' ) ;
370
370
} )
371
371
} )
372
372
} )
0 commit comments