fix(core): update
This commit is contained in:
5
test/plugins.ts
Normal file
5
test/plugins.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import * as qenv from '@pushrocks/qenv';
|
||||
|
||||
export {
|
||||
qenv
|
||||
}
|
36
test/test.ts
Normal file
36
test/test.ts
Normal file
@ -0,0 +1,36 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import * as plugins from './plugins';
|
||||
const testQenv = new plugins.qenv.Qenv('./', './.nogit')
|
||||
|
||||
|
||||
import * as logtail from '../ts/index';
|
||||
|
||||
let testLogtailAccount: logtail.LogTailAccount;
|
||||
|
||||
tap.test('should create a logtail account', async () => {
|
||||
testLogtailAccount = new logtail.LogTailAccount(testQenv.getEnvVarOnDemand('LOGTAIL_TOKEN'));
|
||||
expect(testLogtailAccount).to.be.instanceOf(logtail.LogTailAccount);
|
||||
});
|
||||
|
||||
tap.test('should create a log message', async () => {
|
||||
let x = 0;
|
||||
while (x < 3) {
|
||||
x++;
|
||||
await testLogtailAccount.log({
|
||||
level: 'silly',
|
||||
context: {
|
||||
environment: 'test',
|
||||
runtime: 'node',
|
||||
zone: 'gitzone',
|
||||
containerName: '@mojoio/logtail',
|
||||
},
|
||||
correlation: null,
|
||||
message: `a test from @mojoio/logtail ${x}`,
|
||||
timestamp: Date.now(),
|
||||
type: null,
|
||||
data: {'someData': 'a test from @mojoio/logtail'}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
tap.start();
|
Reference in New Issue
Block a user