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

27 lines
853 B
TypeScript
Raw Normal View History

2024-04-13 05:16:59 +08:00
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);
});
});