@@ -15,9 +15,9 @@ need to be removed first.
15
15
16
16
describe ( '--Integration Tests--' , ( ) => {
17
17
describe ( '--Method Tests--' , ( ) => {
18
- beforeAll ( async ( ) => {
18
+ beforeAll ( ( done ) => {
19
19
client = new ksqljs ( { ksqldbURL : 'http://localhost:8088' } ) ;
20
- await client . ksql ( 'DROP STREAM IF EXISTS TESTJESTSTREAM DELETE TOPIC;' ) ;
20
+ done ( ) ;
21
21
} ) ;
22
22
23
23
afterAll ( async ( ) => {
@@ -38,7 +38,7 @@ describe('--Integration Tests--', () => {
38
38
expect ( streamExists ) . toEqual ( true ) ;
39
39
} )
40
40
41
- it ( '.push properly creates a push query' , ( ) => {
41
+ it ( '.push properly creates a push query' , async ( ) => {
42
42
let pushActive = false ;
43
43
await client . push ( 'SELECT * FROM TESTJESTSTREAM EMIT CHANGES LIMIT 1;' , async ( data ) => {
44
44
if ( JSON . parse ( data ) . queryId ) {
@@ -53,12 +53,6 @@ describe('--Integration Tests--', () => {
53
53
const terminateRes = await client . terminate ( JSON . parse ( data ) . queryId ) ;
54
54
expect ( terminateRes . wasTerminated ) . toEqual ( true ) ;
55
55
} )
56
- // console.log("this is terminate", terminateRes);
57
- // const queriesList = await client.ksql("LIST QUERIES;");
58
- // console.log(queriesList);
59
- // const queryIdDelete = (queriesList.queries[0]).id;
60
- // const response = await client.terminate(queryIdDelete);
61
- // console.log(response);
62
56
} )
63
57
64
58
it ( '.insertStream properly inserts a row into a stream' , async ( ) => {
@@ -155,18 +149,18 @@ describe('--Integration Tests--', () => {
155
149
expect ( tableFound ) . toEqual ( true ) ;
156
150
} )
157
151
158
- it ( 'receives updates from source stream' , async ( ) => {
159
- let rowReceived = false ;
160
- await client . push ( 'SELECT * FROM testAsTable EMIT CHANGES LIMIT 1;' , async ( data ) => {
161
- if ( Array . isArray ( JSON . parse ( data ) ) ) {
162
- if ( JSON . parse ( data ) [ 0 ] === "firstTester" && JSON . parse ( data ) [ 1 ] === 25 ) {
163
- rowReceived = true ;
164
- }
165
- }
166
- } )
167
- await client . insertStream ( 'NEWTESTSTREAM' , [ { "NAME" :"firstTester" , "AGE" :25 } ] ) ;
168
- await waitForExpect ( ( ) => expect ( rowReceived ) . toEqual ( true ) )
169
- } )
152
+ // it('receives updates from source stream', async () => {
153
+ // let rowReceived = false;
154
+ // await client.push('SELECT * FROM testAsTable EMIT CHANGES LIMIT 1;', async (data) => {
155
+ // if (Array.isArray(JSON.parse(data))){
156
+ // if (JSON.parse(data)[0] === "firstTester" && JSON.parse(data)[1] === 25){
157
+ // rowReceived = true;
158
+ // }
159
+ // }
160
+ // })
161
+ // await client.insertStream('NEWTESTSTREAM', [{"NAME":"firstTester", "AGE":25}]);
162
+ // await waitForExpect(() => expect(rowReceived).toEqual(true))
163
+ // })
170
164
} )
171
165
} )
172
166
} )
0 commit comments