@@ -10,14 +10,29 @@ const assert = require("assert"),
1010 deepEqual = require ( "deep-equal" ) ;
1111
1212describe ( "RedisGraphAPI Test" , ( ) => {
13+ // Assuming this test is running against redis server at: localhost:6379 with no password.
1314 const api = new RedisGraph ( "social" ) ;
1415
1516 beforeEach ( ( ) => {
1617 return api . deleteGraph ( ) . catch ( ( ) => { } ) ;
1718 } ) ;
1819
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 ( ) ;
2136 } ) ;
2237
2338 it ( "test Create Node" , async ( ) => {
0 commit comments