import { expect, tap } from '@git.zone/tstest/tapbundle'; // module to test import * as smartconfig from '../ts/index.js'; let testSmartconfig: smartconfig.Smartconfig; tap.test('should create a new Smartconfig instance', async () => { testSmartconfig = new smartconfig.Smartconfig('./test/'); expect(testSmartconfig).toBeInstanceOf(smartconfig.Smartconfig); }); tap.test('should state wether a smartconfig.json exists', async () => { // tslint:disable-next-line:no-unused-expression expect(testSmartconfig.smartconfigJsonExists).toBeTrue(); }); tap.test( 'should pass through default value, if not overriden by config from file', async () => { let testData = testSmartconfig.dataFor('testTool', { someKey2: 'someValue2' }); console.log(testData); expect(testData).toHaveProperty('someKey2'); }, ); tap.test('should read a config file', async () => { let testData = testSmartconfig.dataFor('testTool', { someKey2: 'someValue2', }); expect(testData).toHaveProperty('someKey2'); expect(testData.testValue).toEqual(2); }); tap.start();