@@ -49,6 +49,7 @@ describe('string values', function() {
4949
5050describe ( 'list values' , function ( ) {
5151 it ( 'should support empty lists ' , testVal ( [ ] ) ) ;
52+ it ( 'should support sparse lists ' , testVal ( [ undefined , 4 ] , [ null , 4 ] ) ) ;
5253 it ( 'should support float lists ' , testVal ( [ 1 , 2 , 3 ] ) ) ;
5354 it ( 'should support boolean lists ' , testVal ( [ true , false ] ) ) ;
5455 it ( 'should support string lists ' , testVal ( [ "" , "hello!" ] ) ) ;
@@ -59,6 +60,7 @@ describe('list values', function() {
5960describe ( 'map values' , function ( ) {
6061 it ( 'should support empty maps ' , testVal ( { } ) ) ;
6162 it ( 'should support basic maps ' , testVal ( { a :1 , b :{ } , c :[ ] , d :{ e :1 } } ) ) ;
63+ it ( 'should support sparse maps ' , testVal ( { foo : undefined , bar : null } , { bar : null } ) ) ;
6264} ) ;
6365
6466describe ( 'node values' , function ( ) {
@@ -131,14 +133,14 @@ describe('path values', function() {
131133 } ) ;
132134} ) ;
133135
134- function testVal ( val ) {
136+ function testVal ( val , expected ) {
135137 return function ( done ) {
136138 var driver = neo4j . driver ( "bolt://localhost" , neo4j . auth . basic ( "neo4j" , "neo4j" ) ) ;
137139 var session = driver . session ( ) ;
138140
139141 session . run ( "RETURN {val} as v" , { val : val } )
140142 . then ( function ( result ) {
141- expect ( result . records [ 0 ] . get ( 'v' ) ) . toEqual ( val ) ;
143+ expect ( result . records [ 0 ] . get ( 'v' ) ) . toEqual ( expected || val ) ;
142144 driver . close ( ) ;
143145 done ( ) ;
144146 } ) . catch ( function ( err ) { console . log ( err ) ; } ) ;
0 commit comments