Skip to content

Commit 8e52759

Browse files
bigmontz2hdddg
authored andcommitted
testkit-backend: Handle the types CypherFloat, CypherBool and CypherList
This types were not fully suppoerted previously causing the `TestDataTypes.testShouldEchoVeryLongList` be skipped.
1 parent 7439ae3 commit 8e52759

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

testkit-backend/cypher-native-binders.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,18 @@ export function nativeToCypher (x) {
1313
if (Number.isInteger(x)) {
1414
return valueResponse('CypherInt', x)
1515
}
16-
break
16+
return valueResponse('CypherFloat', x)
1717
case 'string':
1818
return valueResponse('CypherString', x)
1919
case 'boolean':
2020
return valueResponse('CypherBool', x)
2121
case 'object':
22-
console.log(x)
2322
if (neo4j.isInt(x)) {
2423
// TODO: Broken!!!
2524
console.log(x)
2625
return valueResponse('CypherInt', x.toInt())
2726
}
2827
if (Array.isArray(x)) {
29-
const values = x.map(nativeToCypher)
3028
return valueResponse('CypherList', values)
3129
}
3230
if (x instanceof neo4j.types.Node) {
@@ -61,9 +59,13 @@ export function cypherToNative (c) {
6159
case 'CypherInt':
6260
return value
6361
case 'CypherFloat':
64-
return value + 0.0
62+
return value
6563
case 'CypherNull':
6664
return value
65+
case 'CypherBool':
66+
return value
67+
case 'CypherList':
68+
return value.map(cypherToNative)
6769
}
6870
console.log(`Type ${name} is not handle by cypherToNative`, c)
6971
const err = 'Unable to convert ' + c + ' to native type'

0 commit comments

Comments
 (0)