@@ -2,8 +2,9 @@ const { default: waitForExpect } = require('wait-for-expect');
2
2
const ksqljs = require ( '../ksqljs/ksqlJS.js' ) ;
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
// ** INTEGRATION TEST INSTRUCTIONS **
@@ -36,7 +37,7 @@ describe('--Integration Tests--', () => {
36
37
}
37
38
expect ( streamExists ) . toEqual ( true ) ;
38
39
} )
39
-
40
+
40
41
it ( '.push properly creates a push query' , ( ) => {
41
42
let pushActive = false ;
42
43
client . push ( 'SELECT * FROM TESTJESTSTREAM EMIT CHANGES LIMIT 1;' , async ( data ) => {
@@ -46,14 +47,14 @@ describe('--Integration Tests--', () => {
46
47
expect ( pushActive ) . toEqual ( true )
47
48
} ) ;
48
49
} )
49
-
50
+
50
51
it ( '.terminate properly terminates a push query' , ( ) => {
51
52
client . push ( 'SELECT * FROM TESTJESTSTREAM EMIT CHANGES LIMIT 3;' , async ( data ) => {
52
53
const terminateRes = await client . terminate ( JSON . parse ( data ) . queryId ) ;
53
54
expect ( terminateRes . wasTerminated ) . toEqual ( true ) ;
54
55
} )
55
56
} )
56
-
57
+
57
58
it ( '.insertStream properly inserts a row into a stream' , async ( ) => {
58
59
const response = await client . insertStream ( 'TESTJESTSTREAM' , [
59
60
{ "name" : "stab-rabbit" , "email" : "123@mail.com" , "age" : 100 }
@@ -68,7 +69,7 @@ describe('--Integration Tests--', () => {
68
69
}
69
70
} ) ;
70
71
} )
71
-
72
+
72
73
it ( '.pull receives the correct data from a pull query' , async ( ) => {
73
74
const pullData = await client . pull ( "SELECT * FROM TESTJESTSTREAM;" ) ;
74
75
console . log ( pullData [ 1 ] ) ;
@@ -130,7 +131,7 @@ describe('--Integration Tests--', () => {
130
131
client = new ksqljs ( { ksqldbURL : 'http://localhost:8088' } ) ;
131
132
done ( ) ;
132
133
} ) ;
133
-
134
+
134
135
afterAll ( async ( ) => {
135
136
await client . ksql ( 'DROP STREAM IF EXISTS TESTSTREAM2;' ) ;
136
137
} )
@@ -155,7 +156,7 @@ describe('--Integration Tests--', () => {
155
156
queryId : null
156
157
} ) ) ;
157
158
} )
158
-
159
+
159
160
it ( '.inspectServerInfo returns the server info and status' , async ( ) => {
160
161
const status = await client . inspectServerInfo ( ) ;
161
162
// should return something like: {
@@ -174,7 +175,7 @@ describe('--Integration Tests--', () => {
174
175
} )
175
176
} ) ) ;
176
177
} )
177
-
178
+
178
179
it ( '.inspectServerHealth returns the server health' , async ( ) => {
179
180
const status = await client . inspectServerHealth ( ) ;
180
181
// should return something like: {
@@ -195,7 +196,7 @@ describe('--Integration Tests--', () => {
195
196
} )
196
197
) ;
197
198
} )
198
-
199
+
199
200
it ( '.inspectClusterStatus returns the cluster status' , async ( ) => {
200
201
const status = await client . inspectClusterStatus ( ) ;
201
202
// should return something like: {
@@ -212,13 +213,13 @@ describe('--Integration Tests--', () => {
212
213
} )
213
214
) ;
214
215
} )
215
-
216
+
216
217
it ( '.isValidProperty returns true if a server configuration property is not prohibited from setting' , async ( ) => {
217
218
const status = await client . isValidProperty ( 'test' ) ;
218
219
// should return true
219
220
expect ( status . data ) . toEqual ( true ) ;
220
221
} )
221
-
222
+
222
223
// it('isValidProperty returns an error if the server property is prohibited from setting', async () => {
223
224
// const status = await client.isValidProperty('ksql.connect.url');
224
225
// // should return something like
0 commit comments