BREAKING CHANGE(core): switch to esm

This commit is contained in:
2022-07-27 12:00:38 +02:00
parent 057a0a329e
commit 173df91528
14 changed files with 7123 additions and 17838 deletions

View File

@ -1,5 +1,3 @@
import * as smartlog from '@pushrocks/smartlog';
export {
smartlog
}
export { smartlog };

View File

@ -1,18 +1,18 @@
import * as plugins from './plugins';
import * as plugins from './plugins.js';
import { expect, tap } from '@pushrocks/tapbundle';
import * as smartmetrics from '../ts/index';
import * as smartmetrics from '../ts/index.js';
let testSmartMetrics: smartmetrics.SmartMetrics;
tap.test('should create a smartmetrics instance', async () => {
const logger = new plugins.smartlog.Smartlog({
logContext: null,
minimumLogLevel: 'silly'
minimumLogLevel: 'silly',
});
logger.enableConsole();
testSmartMetrics = new smartmetrics.SmartMetrics(logger, 'testContainer');
expect(testSmartMetrics).to.be.instanceOf(smartmetrics.SmartMetrics);
expect(testSmartMetrics).toBeInstanceOf(smartmetrics.SmartMetrics);
});
tap.test('should start smartmetrics', async () => {
@ -20,8 +20,8 @@ tap.test('should start smartmetrics', async () => {
});
tap.test('should produce valid metrics', async (tools) => {
console.log('calling .getMetrics from Testfile:')
console.log('calling .getMetrics from Testfile:');
console.log(await testSmartMetrics.getMetrics());
})
});
tap.start();