@@ -125,7 +125,7 @@ describe('applyGraphTypes', () => {
125125 test ( 'should apply integer type' , ( ) => {
126126 const rawNumber = nativeTypesToCustom ( neo4j . int ( 5 ) )
127127 const typedNumber = applyGraphTypes ( rawNumber )
128- expect ( typedNumber ) . toBeInstanceOf ( neo4j . Integer )
128+ expect ( neo4j . isInt ( typedNumber ) ) . toBeTruthy ( )
129129 } )
130130
131131 test ( 'should apply node type' , ( ) => {
@@ -134,7 +134,7 @@ describe('applyGraphTypes', () => {
134134
135135 const typedNode = applyGraphTypes ( rawNode )
136136 expect ( typedNode ) . toBeInstanceOf ( neo4j . types . Node )
137- expect ( typedNode . identity ) . toBeInstanceOf ( neo4j . Integer )
137+ expect ( neo4j . isInt ( typedNode . identity ) ) . toBeTruthy ( )
138138 } )
139139
140140 test ( 'should not false positive on fake node object type' , ( ) => {
@@ -148,7 +148,8 @@ describe('applyGraphTypes', () => {
148148
149149 const obj = applyGraphTypes ( rawObject )
150150 expect ( obj ) . toBeInstanceOf ( Object )
151- expect ( obj . identity ) . toBeInstanceOf ( neo4j . Integer )
151+ expect ( neo4j . isInt ( obj . identity ) ) . toBeTruthy ( )
152+ expect ( neo4j . isInt ( obj . identity2 ) ) . toBeFalsy ( )
152153 expect ( obj . identity2 ) . toBeInstanceOf ( Object )
153154 expect ( obj [ reservedTypePropertyName ] ) . toEqual ( 'Node' )
154155 } )
@@ -180,7 +181,7 @@ describe('applyGraphTypes', () => {
180181
181182 const typedNode = applyGraphTypes ( rawNode )
182183 expect ( typedNode ) . toBeInstanceOf ( neo4j . types . Node )
183- expect ( typedNode . identity ) . toBeInstanceOf ( neo4j . Integer )
184+ expect ( neo4j . isInt ( typedNode . identity ) ) . toBeTruthy ( )
184185
185186 expect ( typedNode . properties . prop1 ) . toBeNull ( )
186187 expect ( typedNode . properties . prop2 ) . toEqual ( 33 )
@@ -191,7 +192,7 @@ describe('applyGraphTypes', () => {
191192 expect ( typedNode . properties . prop6 . prop1 ) . toEqual ( 1 )
192193 expect ( typedNode . properties . prop6 . prop2 ) . toEqual ( 'test' )
193194
194- expect ( typedNode . properties . prop7 . prop1 ) . toBeInstanceOf ( neo4j . Integer )
195+ expect ( neo4j . isInt ( typedNode . properties . prop7 . prop1 ) ) . toBeTruthy ( )
195196 expect ( typedNode . properties . prop7 . prop1 . toInt ( ) ) . toEqual ( 3 )
196197 expect ( typedNode . properties . prop7 . prop2 ) . toEqual ( 'test' )
197198
@@ -223,9 +224,9 @@ describe('applyGraphTypes', () => {
223224 const typedNodes = applyGraphTypes ( rawNodes , neo4j . types )
224225 expect ( typedNodes . length ) . toEqual ( 2 )
225226 expect ( typedNodes [ 0 ] ) . toBeInstanceOf ( neo4j . types . Node )
226- expect ( typedNodes [ 0 ] . identity ) . toBeInstanceOf ( neo4j . Integer )
227+ expect ( neo4j . isInt ( typedNodes [ 0 ] . identity ) ) . toBeTruthy ( )
227228 expect ( typedNodes [ 1 ] ) . toBeInstanceOf ( neo4j . types . Node )
228- expect ( typedNodes [ 1 ] . identity ) . toBeInstanceOf ( neo4j . Integer )
229+ expect ( neo4j . isInt ( typedNodes [ 1 ] . identity ) ) . toBeTruthy ( )
229230 } )
230231
231232 test ( 'should apply relationship type' , ( ) => {
@@ -241,7 +242,7 @@ describe('applyGraphTypes', () => {
241242
242243 const typedRelationship = applyGraphTypes ( rawRelationship )
243244 expect ( typedRelationship ) . toBeInstanceOf ( neo4j . types . Relationship )
244- expect ( typedRelationship . identity ) . toBeInstanceOf ( neo4j . Integer )
245+ expect ( neo4j . isInt ( typedRelationship . identity ) ) . toBeTruthy ( )
245246 expect ( typedRelationship . type ) . toEqual ( 'TESTED_WITH' )
246247 } )
247248
@@ -268,13 +269,13 @@ describe('applyGraphTypes', () => {
268269 const typedRelationships = applyGraphTypes ( rawRelationships )
269270 expect ( typedRelationships . length ) . toEqual ( 2 )
270271 expect ( typedRelationships [ 0 ] ) . toBeInstanceOf ( neo4j . types . Relationship )
271- expect ( typedRelationships [ 0 ] . identity ) . toBeInstanceOf ( neo4j . Integer )
272- expect ( typedRelationships [ 0 ] . start ) . toBeInstanceOf ( neo4j . Integer )
273- expect ( typedRelationships [ 0 ] . end ) . toBeInstanceOf ( neo4j . Integer )
272+ expect ( neo4j . isInt ( typedRelationships [ 0 ] . identity ) ) . toBeTruthy ( )
273+ expect ( neo4j . isInt ( typedRelationships [ 0 ] . start ) ) . toBeTruthy ( )
274+ expect ( neo4j . isInt ( typedRelationships [ 0 ] . end ) ) . toBeTruthy ( )
274275 expect ( typedRelationships [ 1 ] ) . toBeInstanceOf ( neo4j . types . Relationship )
275- expect ( typedRelationships [ 1 ] . identity ) . toBeInstanceOf ( neo4j . Integer )
276- expect ( typedRelationships [ 1 ] . start ) . toBeInstanceOf ( neo4j . Integer )
277- expect ( typedRelationships [ 1 ] . end ) . toBeInstanceOf ( neo4j . Integer )
276+ expect ( neo4j . isInt ( typedRelationships [ 1 ] . identity ) ) . toBeTruthy ( )
277+ expect ( neo4j . isInt ( typedRelationships [ 1 ] . start ) ) . toBeTruthy ( )
278+ expect ( neo4j . isInt ( typedRelationships [ 1 ] . end ) ) . toBeTruthy ( )
278279 } )
279280
280281 test ( 'should apply to custom object properties' , ( ) => {
@@ -286,7 +287,7 @@ describe('applyGraphTypes', () => {
286287
287288 const typedObject = applyGraphTypes ( rawData )
288289 expect ( typedObject . node ) . toBeInstanceOf ( neo4j . types . Node )
289- expect ( typedObject . num ) . toBeInstanceOf ( neo4j . Integer )
290+ expect ( neo4j . isInt ( typedObject . num ) ) . toBeTruthy ( )
290291 } )
291292
292293 test ( 'should apply to array of custom object properties' , ( ) => {
@@ -304,9 +305,9 @@ describe('applyGraphTypes', () => {
304305 const typedObjects = applyGraphTypes ( rawObj )
305306 expect ( typedObjects . length ) . toEqual ( 2 )
306307 expect ( typedObjects [ 0 ] . node ) . toBeInstanceOf ( neo4j . types . Node )
307- expect ( typedObjects [ 0 ] . num ) . toBeInstanceOf ( neo4j . Integer )
308+ expect ( neo4j . isInt ( typedObjects [ 0 ] . num ) ) . toBeTruthy ( )
308309 expect ( typedObjects [ 1 ] . node ) . toBeInstanceOf ( neo4j . types . Node )
309- expect ( typedObjects [ 1 ] . num ) . toBeInstanceOf ( neo4j . Integer )
310+ expect ( neo4j . isInt ( typedObjects [ 1 ] . num ) ) . toBeTruthy ( )
310311 } )
311312
312313 test ( 'should apply PathSegment type' , ( ) => {
@@ -315,7 +316,7 @@ describe('applyGraphTypes', () => {
315316 expect ( typedPathSegment ) . toBeTruthy ( )
316317 expect ( typedPathSegment ) . toBeInstanceOf ( neo4j . types . PathSegment )
317318 expect ( typedPathSegment . start ) . toBeInstanceOf ( neo4j . types . Node )
318- expect ( typedPathSegment . start . identity ) . toBeInstanceOf ( neo4j . Integer )
319+ expect ( neo4j . isInt ( typedPathSegment . start . identity ) ) . toBeTruthy ( )
319320 expect ( typedPathSegment . end ) . toBeInstanceOf ( neo4j . types . Node )
320321 expect ( typedPathSegment . relationship ) . toBeInstanceOf (
321322 neo4j . types . Relationship
@@ -388,7 +389,7 @@ describe('applyGraphTypes', () => {
388389 } )
389390 const typedObject = applyGraphTypes ( complexObj )
390391 expect ( typedObject ) . toBeTruthy ( )
391- expect ( typedObject . rawNum ) . toBeInstanceOf ( neo4j . Integer )
392+ expect ( neo4j . isInt ( typedObject . rawNum ) ) . toBeTruthy ( )
392393 expect ( typedObject . rawNode ) . toBeInstanceOf ( neo4j . types . Node )
393394 expect ( typedObject . rawRelationship ) . toBeInstanceOf ( neo4j . types . Relationship )
394395 expect ( typedObject . rawPath ) . toBeInstanceOf ( neo4j . types . Path )
@@ -423,7 +424,7 @@ describe('applyGraphTypes', () => {
423424 12 ,
424425 44 ,
425426 0 ,
426- 3600 ,
427+ null ,
427428 'Europe/Stockholm'
428429 )
429430 const rawDateTime = nativeTypesToCustom ( dateTime )
0 commit comments