@@ -10,14 +10,29 @@ const assert = require("assert"),
10
10
deepEqual = require ( "deep-equal" ) ;
11
11
12
12
describe ( "RedisGraphAPI Test" , ( ) => {
13
+ // Assuming this test is running against redis server at: localhost:6379 with no password.
13
14
const api = new RedisGraph ( "social" ) ;
14
15
15
16
beforeEach ( ( ) => {
16
17
return api . deleteGraph ( ) . catch ( ( ) => { } ) ;
17
18
} ) ;
18
19
19
- it ( "test bring your client" , ( ) => {
20
- return new RedisGraph ( "social" , redis . createClient ( ) ) ;
20
+ it ( "test connection from port and host" , async ( ) => {
21
+ // Assuming this test is running against redis server at: localhost:6379 with no password.
22
+ let graph = new RedisGraph ( "social" , "127.0.0.1" , 6379 , { password :undefined } ) ;
23
+ let result = await graph . query ( "CREATE ({name:'roi', age:34})" ) ;
24
+ assert . ok ( ! result . hasNext ( ) ) ;
25
+ assert . equal ( 1 , result . getStatistics ( ) . nodesCreated ( ) ) ;
26
+ graph . deleteGraph ( ) ;
27
+ } )
28
+
29
+ it ( "test connection from client" , async ( ) => {
30
+ // Assuming this test is running against redis server at: localhost:6379 with no password.
31
+ let graph = new RedisGraph ( "social" , redis . createClient ( ) ) ;
32
+ let result = await graph . query ( "CREATE ({name:'roi', age:34})" ) ;
33
+ assert . ok ( ! result . hasNext ( ) ) ;
34
+ assert . equal ( 1 , result . getStatistics ( ) . nodesCreated ( ) ) ;
35
+ graph . deleteGraph ( ) ;
21
36
} ) ;
22
37
23
38
it ( "test Create Node" , async ( ) => {
0 commit comments