Removed force start from themes test

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

- Looking closer into the reason why the test was failing without "forceStart" revealed that the server only start  was overoptimized - "initServicesForFrontend" should be a part of a backend as those are generic theme services.
This commit is contained in:
Naz 2021-11-22 17:38:51 +04:00
parent 8d1863e54b
commit 9c77abebb5
2 changed files with 2 additions and 5 deletions

View File

@ -368,9 +368,9 @@ async function bootGhost({backend = true, frontend = true} = {}) {
// Step 4 - Load Ghost with all its services
debug('Begin: Load Ghost Services & Apps');
await initCore({ghostServer, config, bootLogger, frontend});
await initServicesForFrontend();
if (frontend) {
await initServicesForFrontend();
await initFrontend();
}
const ghostApp = await initExpressApps({frontend, backend});

View File

@ -29,10 +29,7 @@ describe('Themes API', function () {
// NOTE: this flag should not be here! the URL service re-initialization should be fixed instead
// The reason why this init doesn't work without "forceStart" is because during the "restartModeGhostStart"
// the routing.routerManager is never called with "start". That's why a full boot is needed
await localUtils.startGhost({
forceStart: true,
frontend: true
});
await localUtils.startGhost();
ownerRequest = supertest.agent(config.get('url'));
await localUtils.doAuth(ownerRequest);
});