@@ -2,8 +2,9 @@ const ksqljs = require('../ksqljs/ksqlJS.js');
2
2
3
3
// Pre-requisite: start a docker container
4
4
/* To add to README: Prior to running test with 'npm test', please start the ksqlDB
5
- server using the command 'docker compose-up'. This will spin up a ksqlDB server on
6
- 'http://localhost:8088'
5
+ server using the command 'docker-compose up'. This will spin up a ksqlDB server on
6
+ 'http://localhost:8088'. If the command was run before, the created container might
7
+ need to be removed first.
7
8
*/
8
9
9
10
describe ( '--Integration Tests--' , ( ) => {
@@ -31,7 +32,7 @@ describe('--Integration Tests--', () => {
31
32
}
32
33
expect ( streamExists ) . toEqual ( true ) ;
33
34
} )
34
-
35
+
35
36
it ( '.push properly creates a push query' , ( ) => {
36
37
let pushActive = false ;
37
38
client . push ( 'SELECT * FROM TESTJESTSTREAM EMIT CHANGES LIMIT 1;' , async ( data ) => {
@@ -41,14 +42,14 @@ describe('--Integration Tests--', () => {
41
42
expect ( pushActive ) . toEqual ( true )
42
43
} ) ;
43
44
} )
44
-
45
+
45
46
it ( '.terminate properly terminates a push query' , ( ) => {
46
47
client . push ( 'SELECT * FROM TESTJESTSTREAM EMIT CHANGES LIMIT 3;' , async ( data ) => {
47
48
const terminateRes = await client . terminate ( JSON . parse ( data ) . queryId ) ;
48
49
expect ( terminateRes . wasTerminated ) . toEqual ( true ) ;
49
50
} )
50
51
} )
51
-
52
+
52
53
it ( '.insertStream properly inserts a row into a stream' , async ( ) => {
53
54
const response = await client . insertStream ( 'TESTJESTSTREAM' , [
54
55
{ "name" : "stab-rabbit" , "email" : "123@mail.com" , "age" : 100 }
@@ -63,7 +64,7 @@ describe('--Integration Tests--', () => {
63
64
}
64
65
} ) ;
65
66
} )
66
-
67
+
67
68
it ( '.pull receives the correct data from a pull query' , async ( ) => {
68
69
const pullData = await client . pull ( "SELECT * FROM TESTJESTSTREAM;" ) ;
69
70
console . log ( pullData [ 1 ] ) ;
@@ -84,7 +85,7 @@ describe('--Integration Tests--', () => {
84
85
client = new ksqljs ( { ksqldbURL : 'http://localhost:8088' } ) ;
85
86
done ( ) ;
86
87
} ) ;
87
-
88
+
88
89
afterAll ( async ( ) => {
89
90
await client . ksql ( 'DROP STREAM IF EXISTS TESTSTREAM2;' ) ;
90
91
} )
@@ -109,7 +110,7 @@ describe('--Integration Tests--', () => {
109
110
queryId : null
110
111
} ) ) ;
111
112
} )
112
-
113
+
113
114
it ( '.inspectServerInfo returns the server info and status' , async ( ) => {
114
115
const status = await client . inspectServerInfo ( ) ;
115
116
// should return something like: {
@@ -128,7 +129,7 @@ describe('--Integration Tests--', () => {
128
129
} )
129
130
} ) ) ;
130
131
} )
131
-
132
+
132
133
it ( '.inspectServerHealth returns the server health' , async ( ) => {
133
134
const status = await client . inspectServerHealth ( ) ;
134
135
// should return something like: {
@@ -149,7 +150,7 @@ describe('--Integration Tests--', () => {
149
150
} )
150
151
) ;
151
152
} )
152
-
153
+
153
154
it ( '.inspectClusterStatus returns the cluster status' , async ( ) => {
154
155
const status = await client . inspectClusterStatus ( ) ;
155
156
// should return something like: {
@@ -166,13 +167,13 @@ describe('--Integration Tests--', () => {
166
167
} )
167
168
) ;
168
169
} )
169
-
170
+
170
171
it ( '.isValidProperty returns true if a server configuration property is not prohibited from setting' , async ( ) => {
171
172
const status = await client . isValidProperty ( 'test' ) ;
172
173
// should return true
173
174
expect ( status . data ) . toEqual ( true ) ;
174
175
} )
175
-
176
+
176
177
// it('isValidProperty returns an error if the server property is prohibited from setting', async () => {
177
178
// const status = await client.isValidProperty('ksql.connect.url');
178
179
// // should return something like
@@ -188,4 +189,4 @@ describe('--Integration Tests--', () => {
188
189
// }));
189
190
// })
190
191
} )
191
- } )
192
+ } )
0 commit comments