@@ -35,9 +35,7 @@ function assertValidParse(input: string, expected: any, options?: ParseOptions):
3535 var errors : ParseError [ ] = [ ] ;
3636 var actual = parse ( input , errors , options ) ;
3737
38- if ( errors . length !== 0 ) {
39- assert . notEqual ( "undefined" , typeof errors [ 0 ] . error ) ;
40- }
38+ assert . deepEqual ( [ ] , errors )
4139 assert . deepEqual ( actual , expected ) ;
4240}
4341
@@ -244,7 +242,6 @@ suite('JSON', () => {
244242
245243 test ( 'parse: array with errors' , ( ) => {
246244 assertInvalidParse ( '[,]' , [ ] ) ;
247- assertInvalidParse ( '[ 1, 2, ]' , [ 1 , 2 ] ) ;
248245 assertInvalidParse ( '[ 1 2, 3 ]' , [ 1 , 2 , 3 ] ) ;
249246 assertInvalidParse ( '[ ,1, 2, 3 ]' , [ 1 , 2 , 3 ] ) ;
250247 assertInvalidParse ( '[ ,1, 2, 3, ]' , [ 1 , 2 , 3 ] ) ;
@@ -265,9 +262,12 @@ suite('JSON', () => {
265262 assertValidParse ( '{ "hello": [] }' , { hello : [ ] } , options ) ;
266263 assertValidParse ( '{ "hello": [], "world": {}, }' , { hello : [ ] , world : { } } , options ) ;
267264 assertValidParse ( '{ "hello": [], "world": {} }' , { hello : [ ] , world : { } } , options ) ;
265+ assertValidParse ( '[ 1, 2, ]' , [ 1 , 2 ] , options ) ;
266+ assertValidParse ( '[ 1, 2 ]' , [ 1 , 2 ] , options ) ;
268267
269268 assertInvalidParse ( '{ "hello": [], }' , { hello : [ ] } ) ;
270269 assertInvalidParse ( '{ "hello": [], "world": {}, }' , { hello : [ ] , world : { } } ) ;
270+ assertInvalidParse ( '[ 1, 2, ]' , [ 1 , 2 ] ) ;
271271 } ) ;
272272 test ( 'location: properties' , ( ) => {
273273 assertLocation ( '|{ "foo": "bar" }' , [ ] , void 0 , false ) ;
0 commit comments