@@ -49,6 +49,7 @@ describe('string values', function() {
49
49
50
50
describe ( 'list values' , function ( ) {
51
51
it ( 'should support empty lists ' , testVal ( [ ] ) ) ;
52
+ it ( 'should support sparse lists ' , testVal ( [ undefined , 4 ] , [ null , 4 ] ) ) ;
52
53
it ( 'should support float lists ' , testVal ( [ 1 , 2 , 3 ] ) ) ;
53
54
it ( 'should support boolean lists ' , testVal ( [ true , false ] ) ) ;
54
55
it ( 'should support string lists ' , testVal ( [ "" , "hello!" ] ) ) ;
@@ -59,6 +60,7 @@ describe('list values', function() {
59
60
describe ( 'map values' , function ( ) {
60
61
it ( 'should support empty maps ' , testVal ( { } ) ) ;
61
62
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 } ) ) ;
62
64
} ) ;
63
65
64
66
describe ( 'node values' , function ( ) {
@@ -131,14 +133,14 @@ describe('path values', function() {
131
133
} ) ;
132
134
} ) ;
133
135
134
- function testVal ( val ) {
136
+ function testVal ( val , expected ) {
135
137
return function ( done ) {
136
138
var driver = neo4j . driver ( "bolt://localhost" , neo4j . auth . basic ( "neo4j" , "neo4j" ) ) ;
137
139
var session = driver . session ( ) ;
138
140
139
141
session . run ( "RETURN {val} as v" , { val : val } )
140
142
. then ( function ( result ) {
141
- expect ( result . records [ 0 ] . get ( 'v' ) ) . toEqual ( val ) ;
143
+ expect ( result . records [ 0 ] . get ( 'v' ) ) . toEqual ( expected || val ) ;
142
144
driver . close ( ) ;
143
145
done ( ) ;
144
146
} ) . catch ( function ( err ) { console . log ( err ) ; } ) ;
0 commit comments