diff --git a/core/boot.js b/core/boot.js index 78183f326e..472f20b35c 100644 --- a/core/boot.js +++ b/core/boot.js @@ -183,6 +183,7 @@ async function initDynamicRouting() { const routing = require('./frontend/services/routing'); const routeSettingsService = require('./server/services/route-settings'); const bridge = require('./bridge'); + bridge.init(); // We pass the frontend API version + the dynamic routes here, so that the frontend services are slightly less tightly-coupled const apiVersion = bridge.getFrontendApiVersion(); diff --git a/core/bridge.js b/core/bridge.js index 3c9c4add8c..27af4c0d9d 100644 --- a/core/bridge.js +++ b/core/bridge.js @@ -27,7 +27,7 @@ const messages = { }; class Bridge { - constructor() { + init() { /** * When locale changes, we reload theme translations * @deprecated: the term "lang" was deprecated in favor of "locale" publicly in 4.0 diff --git a/test/e2e-api/admin/custom_theme_settings.test.js b/test/e2e-api/admin/custom_theme_settings.test.js index 3049e75e00..e23b09a439 100644 --- a/test/e2e-api/admin/custom_theme_settings.test.js +++ b/test/e2e-api/admin/custom_theme_settings.test.js @@ -11,14 +11,14 @@ describe('Custom Theme Settings API', function () { before(async function () { // NOTE: needs force start to be able to reinitialize Ghost process with frontend services - custom-theme-settings, to be specific await localUtils.startGhost({ - forceStart: true, - frontend: true }); request = supertest.agent(config.get('url')); await localUtils.doAuth(request, 'users:extra', 'custom_theme_settings'); - // require here so we know it's already been set up with models + // require and init here so we know it's already been set up with models const customThemeSettingsService = require('../../../core/server/services/custom-theme-settings'); + await customThemeSettingsService.init(); + // fake a theme activation with custom settings - settings match fixtures await customThemeSettingsService.api.activateTheme('casper', { name: 'casper',