fix(core): update
This commit is contained in:
11
test/test.ts
11
test/test.ts
@ -1,24 +1,25 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import { Qenv } from '@pushrocks/qenv';
|
||||
import * as elasticlog from '../ts/index';
|
||||
import * as elasticsearch from '../ts/index';
|
||||
|
||||
const testQenv = new Qenv('./', './.nogit/');
|
||||
|
||||
let testElasticLog: elasticlog.ElasticLog<any>;
|
||||
let testElasticLog: elasticsearch.ElasticSearch<any>;
|
||||
|
||||
tap.test('first test', async () => {
|
||||
testElasticLog = new elasticlog.ElasticLog({
|
||||
testElasticLog = new elasticsearch.ElasticSearch({
|
||||
domain: process.env.ELK_DOMAIN,
|
||||
port: parseInt(process.env.ELK_PORT, 10),
|
||||
ssl: true,
|
||||
user: process.env.ELK_USER,
|
||||
pass: process.env.ELK_PASS
|
||||
});
|
||||
expect(testElasticLog).to.be.instanceOf(elasticlog.ElasticLog);
|
||||
expect(testElasticLog).to.be.instanceOf(elasticsearch.ElasticSearch);
|
||||
});
|
||||
|
||||
tap.test('should send a message to Elasticsearch', async () => {
|
||||
testElasticLog.log({
|
||||
timestamp: Date.now(),
|
||||
type: 'increment',
|
||||
level: 'info',
|
||||
context: {
|
||||
@ -27,7 +28,7 @@ tap.test('should send a message to Elasticsearch', async () => {
|
||||
containerName: 'testcontainer',
|
||||
environment: 'test',
|
||||
runtime: 'node',
|
||||
zone: 'ship.zone',
|
||||
zone: 'ship.zone'
|
||||
},
|
||||
message: 'hi, this is a testMessage'
|
||||
});
|
||||
|
Reference in New Issue
Block a user