From 28193f86fb7ed6647fb5e1c6469f71a9bb980c38 Mon Sep 17 00:00:00 2001 From: Phillip Thelen Date: Fri, 21 Jun 2024 11:12:18 +0200 Subject: [PATCH] Fix serving memoized content --- test/api/unit/libs/content.test.js | 2 +- website/common/script/content/index.js | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/test/api/unit/libs/content.test.js b/test/api/unit/libs/content.test.js index 53c85e4205..2db4e13859 100644 --- a/test/api/unit/libs/content.test.js +++ b/test/api/unit/libs/content.test.js @@ -55,7 +55,7 @@ describe('contentLib', () => { beforeEach(() => { resSpy = generateRes(); if (fs.existsSync(contentLib.CONTENT_CACHE_PATH)) { - fs.rmdirSync(contentLib.CONTENT_CACHE_PATH, { recursive: true }); + fs.rmSync(contentLib.CONTENT_CACHE_PATH, { recursive: true }); } fs.mkdirSync(contentLib.CONTENT_CACHE_PATH); }); diff --git a/website/common/script/content/index.js b/website/common/script/content/index.js index b3c12b2098..d934a2c5e6 100644 --- a/website/common/script/content/index.js +++ b/website/common/script/content/index.js @@ -168,12 +168,15 @@ api.special = api.spells.special; Object.defineProperty(api, 'dropEggs', { get () { return eggs.drops; }, + enumerable: true, }); Object.defineProperty(api, 'questEggs', { get () { return eggs.quests; }, + enumerable: true, }); Object.defineProperty(api, 'eggs', { get () { return eggs.all; }, + enumerable: true, }); api.timeTravelStable = { @@ -195,53 +198,68 @@ api.timeTravelStable = { Object.defineProperty(api, 'dropHatchingPotions', { get () { return hatchingPotions.drops; }, + enumerable: true, }); Object.defineProperty(api, 'premiumHatchingPotions', { get () { return hatchingPotions.premium; }, + enumerable: true, }); Object.defineProperty(api, 'wackyHatchingPotions', { get () { return hatchingPotions.wacky; }, + enumerable: true, }); Object.defineProperty(api, 'hatchingPotions', { get () { return hatchingPotions.all; }, + enumerable: true, }); Object.defineProperty(api, 'dropPets', { get () { return stable.dropPets; }, + enumerable: true, }); Object.defineProperty(api, 'premiumPets', { get () { return stable.premiumPets; }, + enumerable: true, }); Object.defineProperty(api, 'questPets', { get () { return stable.questPets; }, + enumerable: true, }); Object.defineProperty(api, 'specialPets', { get () { return stable.specialPets; }, + enumerable: true, }); Object.defineProperty(api, 'wackyPets', { get () { return stable.wackyPets; }, + enumerable: true, }); Object.defineProperty(api, 'petInfo', { get () { return stable.petInfo; }, + enumerable: true, }); Object.defineProperty(api, 'dropMounts', { get () { return stable.dropMounts; }, + enumerable: true, }); Object.defineProperty(api, 'premiumMounts', { get () { return stable.premiumMounts; }, + enumerable: true, }); Object.defineProperty(api, 'questMounts', { get () { return stable.questMounts; }, + enumerable: true, }); Object.defineProperty(api, 'specialMounts', { get () { return stable.specialMounts; }, + enumerable: true, }); Object.defineProperty(api, 'mountInfo', { get () { return stable.mountInfo; }, + enumerable: true, }); -function buildFood() { +function buildFood () { const food = { Meat: { text: t('foodMeat'),