Skip to content

Commit abe986a

Browse files
Merge pull request #29 from oslabs-beta/mx/jestTestsBranch
Mx/jest tests branch
2 parents c108bc5 + a0bc9aa commit abe986a

File tree

4 files changed

+18
-65
lines changed

4 files changed

+18
-65
lines changed

__tests__/integrationtests.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ need to be removed first.
1515

1616
describe('--Integration Tests--', () => {
1717
describe('--Method Tests--', () => {
18-
beforeAll(async () => {
18+
beforeAll((done) => {
1919
client = new ksqljs({ ksqldbURL: 'http://localhost:8088' });
20-
await client.ksql('DROP STREAM IF EXISTS TESTJESTSTREAM DELETE TOPIC;');
20+
done();
2121
});
2222

2323
afterAll(async () => {
@@ -38,9 +38,9 @@ describe('--Integration Tests--', () => {
3838
expect(streamExists).toEqual(true);
3939
})
4040

41-
it('.push properly creates a push query', () => {
41+
it('.push properly creates a push query', async () => {
4242
let pushActive = false;
43-
client.push('SELECT * FROM TESTJESTSTREAM EMIT CHANGES LIMIT 1;', async (data) => {
43+
await client.push('SELECT * FROM TESTJESTSTREAM EMIT CHANGES LIMIT 1;', async (data) => {
4444
if (JSON.parse(data).queryId) {
4545
pushActive = true;
4646
}
@@ -149,18 +149,18 @@ describe('--Integration Tests--', () => {
149149
expect(tableFound).toEqual(true);
150150
})
151151

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-
})
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+
// })
164164
})
165165
})
166166
})

ksqldbJS_classTest.js

Lines changed: 0 additions & 48 deletions
This file was deleted.

ksqljs/ksqlJS.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ class ksqljs {
371371
return axios.post(this.ksqldbURL + '/ksql', { ksql: query })
372372
.catch(error => console.log(error));
373373
}
374+
374375
/**
375376
* Inserts rows of data into a stream.
376377
*

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "",
55
"main": "ksqljsTest.js",
66
"scripts": {
7-
"test": "jest --verbose --detectOpenHandles"
7+
"test": "jest --verbose"
88
},
99
"keywords": [],
1010
"author": "",

0 commit comments

Comments
 (0)