0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Moved loadAllThemes out of test util

- this was skipped on boot, but then called in the test utilities, but only on restart 🙈
- this means that yarn test:acceptance (i.e. running all tests) works, but if you try to run just test/api-acceptance/themes_spec.js it would fail because that uses a fresh boot not a restart/reload
- I've changed this as keeping the test using the real boot, rather than the made-up acceptance-utils tasks as much as possible is way better
This commit is contained in:
Hannah Wolfe 2021-07-06 17:10:15 +01:00
parent afb81a5c73
commit b1b09efd75
No known key found for this signature in database
GPG key ID: 9F8C7532D0A6BA55
2 changed files with 4 additions and 7 deletions

View file

@ -219,6 +219,10 @@ async function initServices({config}) {
async function initBackgroundServices({config}) {
debug('Begin: initBackgroundServices');
// Load all inactive themes
const themeService = require('./server/services/themes');
themeService.loadInactiveThemes();
// we don't want to kick off background services that will interfere with tests
if (process.env.NODE_ENV.match(/^testing/)) {
return;
@ -230,10 +234,6 @@ async function initBackgroundServices({config}) {
await emailAnalyticsJobs.scheduleRecurringJobs();
}
// Load all inactive themes
const themeService = require('./server/services/themes');
themeService.loadInactiveThemes();
const updateCheck = require('./server/update-check');
updateCheck.scheduleRecurringJobs();

View file

@ -118,9 +118,6 @@ const restartModeGhostStart = async () => {
// @TODO: why does this happen _after_ URL service
web.shared.middlewares.customRedirects.reload();
// Trigger themes to load again
themeService.loadInactiveThemes();
// Reload limits service
limits.init();
};