mirror of
https://github.com/bpatrik/pigallery2.git
synced 2024-12-23 01:27:14 +02:00
Add config def. loading test
This commit is contained in:
parent
4d6795c14f
commit
39b6011d4a
16
test/common/unit/config/Config.ts
Normal file
16
test/common/unit/config/Config.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import {expect} from 'chai';
|
||||
import { ConfigClassBuilder } from 'typeconfig/node';
|
||||
import {ExtensionConfigWrapper} from '../../../../src/backend/model/extension/ExtensionConfigWrapper';
|
||||
|
||||
|
||||
describe('Config', () => {
|
||||
it('should load default from env', () => {
|
||||
process.env['default-Media-tempFolder'] = 'test/test'
|
||||
const conf = ExtensionConfigWrapper.originalSync();
|
||||
console.log(ConfigClassBuilder.attachPrivateInterface(conf.Media).__defaults);
|
||||
expect(ConfigClassBuilder.attachPrivateInterface(conf.Media).__defaults.tempFolder).to.be.equal('test/test');
|
||||
expect(process.env['default-Media-tempFolder']).to.be.equal('test/test');
|
||||
const conf2 = ExtensionConfigWrapper.originalSync();
|
||||
expect(ConfigClassBuilder.attachPrivateInterface(conf2.Media).__defaults.tempFolder).to.be.equal('test/test');
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user