Cleaned up mock-express tests from unnecessary inits

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

- Have skimmed through the test suites in hopes to find some quick performance wins to bring the runtime speed closer to the one in "main". Haven't been successful to identify major wins, cleaned up a couple of small bits.
- We'll have to live with a tradeoff between maintainability/unified boot VS cost of mainitaining a fake boot process. Imo extra couple seconds of runtime is worth it.
This commit is contained in:
Naz 2021-12-06 11:07:09 +04:00 committed by naz
parent abcd715907
commit 3c19a8f014
4 changed files with 0 additions and 11 deletions

View File

@ -21,11 +21,9 @@ describe('Integration - Web - Site canary', function () {
describe('default routes.yaml', function () { describe('default routes.yaml', function () {
before(async function () { before(async function () {
localUtils.urlService.resetGenerators();
localUtils.defaultMocks(sinon, {amp: true}); localUtils.defaultMocks(sinon, {amp: true});
localUtils.overrideGhostConfig(configUtils); localUtils.overrideGhostConfig(configUtils);
await routeSettingsService.init();
app = await localUtils.initGhost(); app = await localUtils.initGhost();
}); });

View File

@ -21,7 +21,6 @@ describe('Integration - Web - Site v2', function () {
describe('default routes.yaml', function () { describe('default routes.yaml', function () {
before(async function () { before(async function () {
localUtils.urlService.resetGenerators();
localUtils.defaultMocks(sinon, {amp: true}); localUtils.defaultMocks(sinon, {amp: true});
localUtils.overrideGhostConfig(configUtils); localUtils.overrideGhostConfig(configUtils);

View File

@ -21,7 +21,6 @@ describe('Integration - Web - Site v3', function () {
describe('default routes.yaml', function () { describe('default routes.yaml', function () {
before(async function () { before(async function () {
localUtils.urlService.resetGenerators();
localUtils.defaultMocks(sinon, {amp: true}); localUtils.defaultMocks(sinon, {amp: true});
localUtils.overrideGhostConfig(configUtils); localUtils.overrideGhostConfig(configUtils);

View File

@ -2,7 +2,6 @@ const should = require('should');
const sinon = require('sinon'); const sinon = require('sinon');
const testUtils = require('../../utils'); const testUtils = require('../../utils');
const localUtils = require('./utils'); const localUtils = require('./utils');
const adminUtils = require('../../utils/admin-utils');
const configUtils = require('../../utils/configUtils'); const configUtils = require('../../utils/configUtils');
const urlUtils = require('../../utils/urlUtils'); const urlUtils = require('../../utils/urlUtils');
const themeEngine = require('../../../core/frontend/services/theme-engine'); const themeEngine = require('../../../core/frontend/services/theme-engine');
@ -10,10 +9,7 @@ const themeEngine = require('../../../core/frontend/services/theme-engine');
describe('Integration - Web - vhosts', function () { describe('Integration - Web - vhosts', function () {
let app; let app;
before(localUtils.urlService.resetGenerators);
before(testUtils.teardownDb); before(testUtils.teardownDb);
before(testUtils.setup('users:roles', 'posts'));
before(adminUtils.stubClientFiles);
after(function () { after(function () {
configUtils.restore(); configUtils.restore();
@ -23,7 +19,6 @@ describe('Integration - Web - vhosts', function () {
describe('no separate admin', function () { describe('no separate admin', function () {
before(async function () { before(async function () {
localUtils.urlService.resetGenerators();
localUtils.defaultMocks(sinon, {amp: true}); localUtils.defaultMocks(sinon, {amp: true});
localUtils.overrideGhostConfig(configUtils); localUtils.overrideGhostConfig(configUtils);
@ -132,7 +127,6 @@ describe('Integration - Web - vhosts', function () {
describe('separate admin host', function () { describe('separate admin host', function () {
before(async function () { before(async function () {
localUtils.urlService.resetGenerators();
localUtils.defaultMocks(sinon, {amp: true}); localUtils.defaultMocks(sinon, {amp: true});
localUtils.overrideGhostConfig(configUtils); localUtils.overrideGhostConfig(configUtils);
@ -286,7 +280,6 @@ describe('Integration - Web - vhosts', function () {
describe('separate admin host w/ admin redirects disabled', function () { describe('separate admin host w/ admin redirects disabled', function () {
before(async function () { before(async function () {
localUtils.urlService.resetGenerators();
localUtils.defaultMocks(sinon, {amp: true}); localUtils.defaultMocks(sinon, {amp: true});
localUtils.overrideGhostConfig(configUtils); localUtils.overrideGhostConfig(configUtils);