smartmetrics/test/test.ts

28 lines
811 B
TypeScript
Raw Normal View History

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