From 9375a1701a57dd658f0bcf319ad8ef0dcac851b3 Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Fri, 11 Feb 2022 11:08:28 +0000 Subject: [PATCH] Revert "Fixed theme storage getting confused between tests" This reverts commit 3e7039c47d5b7fdf52fe36517e8180aaa7e562c5. --- core/server/services/themes/storage.js | 3 --- test/utils/e2e-framework.js | 9 +++------ test/utils/e2e-utils.js | 2 -- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/core/server/services/themes/storage.js b/core/server/services/themes/storage.js index 390b81a0d3..9a95981c30 100644 --- a/core/server/services/themes/storage.js +++ b/core/server/services/themes/storage.js @@ -148,8 +148,5 @@ module.exports = { let result = await getStorage().delete(themeName); list.del(themeName); return result; - }, - updateStoragePath: function (storagePath) { - getStorage().storagePath = storagePath; } }; diff --git a/test/utils/e2e-framework.js b/test/utils/e2e-framework.js index 54ed95924f..35ca864047 100644 --- a/test/utils/e2e-framework.js +++ b/test/utils/e2e-framework.js @@ -25,23 +25,20 @@ const redirectsUtils = require('./redirects'); const configUtils = require('./configUtils'); const mockManager = require('./e2e-framework-mock-manager'); -const themeStorage = require('../../core/server/services/themes/storage'); - const boot = require('../../core/boot'); const TestAgent = require('./test-agent'); const db = require('./db-utils'); const startGhost = async () => { /** - * We never use the root content folder for testing! - * We use a tmp folder. - */ + * We never use the root content folder for testing! + * We use a tmp folder. + */ const contentFolder = path.join(os.tmpdir(), uuid.v4(), 'ghost-test'); await prepareContentFolder({contentFolder}); // NOTE: need to pass this config to the server instance configUtils.set('paths:contentPath', contentFolder); - themeStorage.updateStoragePath(configUtils.config.getContentPath('themes')); const defaults = { backend: true, diff --git a/test/utils/e2e-utils.js b/test/utils/e2e-utils.js index 1e24aba1c3..bd04863a44 100644 --- a/test/utils/e2e-utils.js +++ b/test/utils/e2e-utils.js @@ -18,7 +18,6 @@ const urlService = require('../../core/server/services/url'); const settingsService = require('../../core/server/services/settings'); const routeSettingsService = require('../../core/server/services/route-settings'); const themeService = require('../../core/server/services/themes'); -const themeStorage = require('../../core/server/services/themes/storage'); const limits = require('../../core/server/services/limits'); const customRedirectsService = require('../../core/server/services/redirects'); @@ -70,7 +69,6 @@ const prepareContentFolder = (options) => { * We use a tmp folder. */ configUtils.set('paths:contentPath', contentFolderForTests); - themeStorage.updateStoragePath(configUtils.config.getContentPath('themes')); fs.ensureDirSync(contentFolderForTests); fs.ensureDirSync(path.join(contentFolderForTests, 'data'));