Content API Cache improvements (#12020)

* content api improvements

* add content cache to build step

* add tests
This commit is contained in:
Matteo Pagliazzi
2020-03-29 16:15:23 +02:00
committed by GitHub
parent 9ab9b0f553
commit 3fffe7aa5c
7 changed files with 101 additions and 89 deletions

View File

@@ -0,0 +1,17 @@
import * as contentLib from '../../../../website/server/libs/content';
import content from '../../../../website/common/script/content';
describe('contentLib', () => {
describe('CONTENT_CACHE_PATH', () => {
it('exports CONTENT_CACHE_PATH', () => {
expect(contentLib.CONTENT_CACHE_PATH).to.be.a.string;
});
});
describe('getLocalizedContent', () => {
it('clones, not modify, the original content data', () => {
contentLib.getLocalizedContent();
expect(typeof content.backgrounds.backgrounds062014.beach.text).to.equal('function');
});
});
});