1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/test/backend/unit/model/extension/ExtensionConfigWrapper.spec.ts
2024-04-12 23:29:59 +02:00

27 lines
853 B
TypeScript

import {expect} from 'chai';
import {ExtensionConfigWrapper} from '../../../../../src/backend/model/extension/ExtensionConfigWrapper';
import {TAGS} from '../../../../../src/common/config/public/ClientConfig';
// to help WebStorm to handle the test cases
declare let describe: any;
declare const after: any;
declare const before: any;
declare const it: any;
describe('ExtensionConfigWrapper', () => {
it('should load original config multiple times with the same result', async () => {
const get = async () => JSON.parse(JSON.stringify((await ExtensionConfigWrapper.original()).toJSON({
attachState: true,
attachVolatile: true,
skipTags: {secret: true} as TAGS
})));
const a = await get();
const b = await get();
expect(b).to.deep.equal(a);
const c = await get();
expect(c).to.deep.equal(a);
});
});