2018-11-11 13:29:26 +00:00
|
|
|
import { expect, tap } from '@pushrocks/tapbundle';
|
2018-11-11 18:40:59 +00:00
|
|
|
import { Qenv } from '@pushrocks/qenv';
|
|
|
|
import * as smartlog from '@pushrocks/smartlog';
|
|
|
|
const testQenv = new Qenv('./', './.nogit/');
|
|
|
|
|
2018-11-11 13:29:26 +00:00
|
|
|
import * as smartlogDestinationReceiver from '../ts/index';
|
|
|
|
|
2018-11-11 18:40:59 +00:00
|
|
|
let testSmartlogReceiver: smartlogDestinationReceiver.SmartlogDestinationReceiver;
|
|
|
|
|
|
|
|
tap.test('should create a valid SmartlogDestinationReceiver', async () => {
|
|
|
|
testSmartlogReceiver = new smartlogDestinationReceiver.SmartlogDestinationReceiver({
|
|
|
|
receiverEndpoint: process.env.RECEIVER_ENDPOINT,
|
|
|
|
passphrase: process.env.PASSPHRASE
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
tap.test('should send a valid message', async () => {
|
|
|
|
testSmartlogReceiver.handleLog({
|
|
|
|
timestamp: Date.now(),
|
|
|
|
context: {
|
|
|
|
company: 'Lossless GmbH',
|
|
|
|
companyunit: 'Lossless Cloud',
|
|
|
|
containerName: null,
|
|
|
|
environment: 'local',
|
|
|
|
runtime: 'node',
|
|
|
|
zone: 'gitzone'
|
|
|
|
},
|
|
|
|
type: 'log',
|
|
|
|
level: 'info',
|
2020-06-05 16:10:52 +00:00
|
|
|
message: 'This is a message'
|
2018-11-11 18:40:59 +00:00
|
|
|
});
|
2018-11-11 13:29:26 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
tap.start();
|