0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Fixed frontend initialization in "mock-express" tests

refs https://github.com/TryGhost/Toolbox/issues/135

- Without sensible defaults the web app was not initializing either the backend nor the frontned parts of the application. Fixed the defaults so the problem doesn't happen again and optimized mock-express-style initialization to only initialize the frontend routing
This commit is contained in:
Naz 2021-11-19 18:26:23 +04:00 committed by naz
parent d0dfac438d
commit 149c100b4c
2 changed files with 6 additions and 4 deletions

View file

@ -8,10 +8,10 @@ const vhost = require('@tryghost/vhost-middleware');
/**
* @param {Object} options
* @param {Boolean} [options.start]
* @param {Boolean} options.withBackend
* @param {Boolean} options.withFrontend
* @param {Boolean} [options.withBackend]
* @param {Boolean} [options.withFrontend]
*/
module.exports = function setupParentApp({start, withFrontend, withBackend}) {
module.exports = function setupParentApp({start, withFrontend = true, withBackend = true}) {
debug('ParentApp setup start');
const parentApp = express('parent');

View file

@ -59,7 +59,9 @@ module.exports = {
const helperService = require('../../../../core/frontend/services/helpers');
await helperService.init();
const app = siteApp({start: true});
const app = siteApp({
start: true
});
await appService.init();
await urlServiceUtils.isFinished();