fix(core): update
This commit is contained in:
30
test/test.ts
Normal file
30
test/test.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import { expect, expectAsync, tap } from '@pushrocks/tapbundle';
|
||||
import * as smartclickhouse from '../ts/index';
|
||||
|
||||
let testClickhouseDb: smartclickhouse.ClickhouseDb;
|
||||
|
||||
tap.test('first test', async () => {
|
||||
testClickhouseDb = new smartclickhouse.ClickhouseDb({
|
||||
url: 'http://localhost',
|
||||
port: 8123,
|
||||
});
|
||||
});
|
||||
|
||||
tap.test('should start the clickhouse db', async () => {
|
||||
await testClickhouseDb.start();
|
||||
})
|
||||
|
||||
tap.test('should write something to the clickhouse db', async () => {
|
||||
const result = await testClickhouseDb.clickhouseClient.query(`CREATE DATABASE IF NOT EXISTS lossless`);
|
||||
console.log(result);
|
||||
const result2 = await testClickhouseDb.clickhouseClient.query(`CREATE TABLE IF NOT EXISTS lossless.visits (
|
||||
timestamp UInt64,
|
||||
ip String,
|
||||
os String,
|
||||
userAgent String,
|
||||
version String
|
||||
)`);
|
||||
console.log(result);
|
||||
})
|
||||
|
||||
tap.start();
|
Reference in New Issue
Block a user