diff --git a/bolt-connection/src/packstream/packstream-v1.js b/bolt-connection/src/packstream/packstream-v1.js index d2b438b68..b1361cac5 100644 --- a/bolt-connection/src/packstream/packstream-v1.js +++ b/bolt-connection/src/packstream/packstream-v1.js @@ -23,6 +23,7 @@ import { int, isInt, Integer, + toNumber, Node, Path, PathSegment, @@ -635,7 +636,7 @@ class Unpacker { for (let i = 0; i < sequence.length; i += 2) { const nextNode = nodes[sequence[i + 1]] - const relIndex = sequence[i] + const relIndex = toNumber(sequence[i]) let rel if (relIndex > 0) { diff --git a/testkit-backend/src/cypher-native-binders.js b/testkit-backend/src/cypher-native-binders.js index 6247c2bfd..781590d2b 100644 --- a/testkit-backend/src/cypher-native-binders.js +++ b/testkit-backend/src/cypher-native-binders.js @@ -37,6 +37,45 @@ export function nativeToCypher (x) { } return { name: 'CypherNode', data: node } } + if (x instanceof neo4j.types.Relationship) { + const relationship = { + id: nativeToCypher(x.identity), + startNodeId: nativeToCypher(x.start), + endNodeId: nativeToCypher(x.end), + type: nativeToCypher(x.type), + props: nativeToCypher(x.properties) + } + return { name: 'CypherRelationship', data: relationship } + } + if (x instanceof neo4j.types.Path) { + const path = x.segments + .map(segment => { + return { + nodes: [segment.end], + relationships: [segment.relationship] + } + }) + .reduce( + (previous, current) => { + return { + nodes: [...previous.nodes, ...current.nodes], + relationships: [ + ...previous.relationships, + ...current.relationships + ] + } + }, + { nodes: [x.start], relationships: [] } + ) + + return { + name: 'CypherPath', + data: { + nodes: nativeToCypher(path.nodes), + relationships: nativeToCypher(path.relationships) + } + } + } // If all failed, interpret as a map const map = {} for (const [key, value] of Object.entries(x)) { diff --git a/testkit-backend/src/skipped-tests.js b/testkit-backend/src/skipped-tests.js index 708d3ae4e..43457c866 100644 --- a/testkit-backend/src/skipped-tests.js +++ b/testkit-backend/src/skipped-tests.js @@ -19,6 +19,10 @@ function skip (reason, ...predicate) { } const skippedTests = [ + skip( + 'Not support by the JS driver', + ifEquals('neo4j.sessionrun.TestSessionRun.test_partial_iteration') + ), skip( 'The driver has no support domain_name_resolver', ifEndsWith('test_should_successfully_acquire_rt_when_router_ip_changes'),