smartmetrics/test/test.ts

28 lines
803 B
TypeScript
Raw Normal View History

2021-08-12 21:19:39 +00:00
import * as plugins from './plugins';
import { expect, tap } from '@pushrocks/tapbundle';
import * as smartmetrics from '../ts/index';
let testSmartMetrics: smartmetrics.SmartMetrics;
tap.test('should create a smartmetrics instance', async () => {
const logger = new plugins.smartlog.Smartlog({
logContext: null,
minimumLogLevel: 'silly'
});
logger.enableConsole();
testSmartMetrics = new smartmetrics.SmartMetrics(logger, 'testContainer');
expect(testSmartMetrics).to.be.instanceOf(smartmetrics.SmartMetrics);
});
tap.test('should start smartmetrics', async () => {
testSmartMetrics.start();
});
2021-08-14 15:01:54 +00:00
tap.test('should produce valid metrics', async (tools) => {
console.log('calling .getMetrics from Testfile:')
2021-08-12 21:19:39 +00:00
console.log(await testSmartMetrics.getMetrics());
})
tap.start();