diff --git a/test/e2e-api/admin/settings.test.js b/test/e2e-api/admin/settings.test.js index e84549f8d8..5e72dca61f 100644 --- a/test/e2e-api/admin/settings.test.js +++ b/test/e2e-api/admin/settings.test.js @@ -10,16 +10,15 @@ const labs = require('../../../core/shared/labs'); describe('Settings API', function () { let request; - let ghostServer; before(async function () { - ghostServer = await localUtils.startGhost(); + await localUtils.startGhost(); request = supertest.agent(config.get('url')); await localUtils.doAuth(request); }); after(function () { - return ghostServer.stop(); + return testUtils.stopGhost(); }); it('Can request all settings', async function () { @@ -262,6 +261,6 @@ describe('Settings API', function () { .expect(200); res.headers['x-cache-invalidate'].should.eql('/*'); - await ghostServer.stop(); + await testUtils.stopGhost(); }); }); diff --git a/test/regression/api/canary/admin/authentication.test.js b/test/regression/api/canary/admin/authentication.test.js index b9dea3385e..bdee7f3ea3 100644 --- a/test/regression/api/canary/admin/authentication.test.js +++ b/test/regression/api/canary/admin/authentication.test.js @@ -12,13 +12,10 @@ const mailService = require('../../../../../core/server/services/mail/index'); let request; describe('Authentication API v3', function () { - let ghostServer; - describe('Blog setup', function () { before(function () { return testUtils.startGhost({forceStart: true}) - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }); }); @@ -139,8 +136,7 @@ describe('Authentication API v3', function () { describe('Invitation', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); // simulates blog setup (initialises the owner) diff --git a/test/regression/api/canary/admin/identities.test.js b/test/regression/api/canary/admin/identities.test.js index b91d03e61c..fe5b175766 100644 --- a/test/regression/api/canary/admin/identities.test.js +++ b/test/regression/api/canary/admin/identities.test.js @@ -71,7 +71,7 @@ describe('Identities API', function () { describe('As non-Owner', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { diff --git a/test/regression/api/canary/admin/members_signin_url.test.js b/test/regression/api/canary/admin/members_signin_url.test.js index cdd51acb86..f1b866a3bd 100644 --- a/test/regression/api/canary/admin/members_signin_url.test.js +++ b/test/regression/api/canary/admin/members_signin_url.test.js @@ -87,7 +87,7 @@ describe('Members Sigin URL API', function () { describe('As non-Owner and non-Admin', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { diff --git a/test/regression/api/canary/admin/notifications.test.js b/test/regression/api/canary/admin/notifications.test.js index 1fba387c74..acb3a765c3 100644 --- a/test/regression/api/canary/admin/notifications.test.js +++ b/test/regression/api/canary/admin/notifications.test.js @@ -10,7 +10,7 @@ describe('Notifications API', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { @@ -70,7 +70,7 @@ describe('Notifications API', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { @@ -118,7 +118,7 @@ describe('Notifications API', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { + .then(function () { requestEditor1 = supertest.agent(config.get('url')); requestEditor2 = supertest.agent(config.get('url')); }) diff --git a/test/regression/api/canary/admin/pages.test.js b/test/regression/api/canary/admin/pages.test.js index 69c06c8275..2e2e5786e2 100644 --- a/test/regression/api/canary/admin/pages.test.js +++ b/test/regression/api/canary/admin/pages.test.js @@ -8,7 +8,7 @@ let request; describe('Pages API', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { diff --git a/test/regression/api/canary/admin/settings.test.js b/test/regression/api/canary/admin/settings.test.js index fc86783928..cc83716280 100644 --- a/test/regression/api/canary/admin/settings.test.js +++ b/test/regression/api/canary/admin/settings.test.js @@ -437,14 +437,12 @@ const defaultSettingsKeyTypes = [ ]; describe('Settings API (canary)', function () { - let ghostServer; let request; describe('As Owner', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { @@ -1270,9 +1268,8 @@ describe('Settings API (canary)', function () { describe('As Admin', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { - ghostServer = _ghostServer; - request = supertest.agent(config.get('url')); + .then(function () { + request = supertest.agent(config.get('url')); }) .then(function () { // create admin @@ -1295,8 +1292,7 @@ describe('Settings API (canary)', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { @@ -1356,8 +1352,7 @@ describe('Settings API (canary)', function () { describe('As Author', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { diff --git a/test/regression/api/canary/admin/slack.test.js b/test/regression/api/canary/admin/slack.test.js index 7be8530792..c9b7f1011a 100644 --- a/test/regression/api/canary/admin/slack.test.js +++ b/test/regression/api/canary/admin/slack.test.js @@ -9,12 +9,9 @@ const events = require('../../../../../core/server/lib/common/events'); let request; describe('Slack API', function () { - let ghostServer; - before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { diff --git a/test/regression/api/canary/admin/users.test.js b/test/regression/api/canary/admin/users.test.js index bc4db5696d..d075f50833 100644 --- a/test/regression/api/canary/admin/users.test.js +++ b/test/regression/api/canary/admin/users.test.js @@ -9,15 +9,13 @@ let request; describe('User API', function () { let editor; let author; - let ghostServer; let otherAuthor; let admin; describe('As Owner', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { @@ -149,8 +147,7 @@ describe('User API', function () { describe('As Editor', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { @@ -229,8 +226,7 @@ describe('User API', function () { describe('As Author', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { diff --git a/test/regression/api/canary/content/authors.test.js b/test/regression/api/canary/content/authors.test.js index 53611a7785..b354bf4fa1 100644 --- a/test/regression/api/canary/content/authors.test.js +++ b/test/regression/api/canary/content/authors.test.js @@ -11,7 +11,7 @@ describe('Authors Content API', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { diff --git a/test/regression/api/v2/admin/authentication.test.js b/test/regression/api/v2/admin/authentication.test.js index 3bd62f940c..3d23b62351 100644 --- a/test/regression/api/v2/admin/authentication.test.js +++ b/test/regression/api/v2/admin/authentication.test.js @@ -13,13 +13,10 @@ const configUtils = require('../../../../utils/configUtils'); let request; describe('Authentication API v2', function () { - let ghostServer; - describe('Blog setup: default config', function () { before(function () { return testUtils.startGhost({forceStart: true}) - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }); }); @@ -138,8 +135,7 @@ describe('Authentication API v2', function () { describe('Blog setup: custom config', function () { before(function () { return testUtils.startGhost({forceStart: true}) - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }); }); @@ -261,8 +257,7 @@ describe('Authentication API v2', function () { describe('Invitation', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); // simulates blog setup (initialises the owner) diff --git a/test/regression/api/v2/admin/notifications.test.js b/test/regression/api/v2/admin/notifications.test.js index 1fba387c74..acb3a765c3 100644 --- a/test/regression/api/v2/admin/notifications.test.js +++ b/test/regression/api/v2/admin/notifications.test.js @@ -10,7 +10,7 @@ describe('Notifications API', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { @@ -70,7 +70,7 @@ describe('Notifications API', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { @@ -118,7 +118,7 @@ describe('Notifications API', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { + .then(function () { requestEditor1 = supertest.agent(config.get('url')); requestEditor2 = supertest.agent(config.get('url')); }) diff --git a/test/regression/api/v2/admin/oembed.test.js b/test/regression/api/v2/admin/oembed.test.js index 3c2ab36157..e0644b4481 100644 --- a/test/regression/api/v2/admin/oembed.test.js +++ b/test/regression/api/v2/admin/oembed.test.js @@ -10,13 +10,11 @@ const localUtils = require('./utils'); const dnsPromises = require('dns').promises; describe('Oembed API (v2)', function () { - let ghostServer; let request; before(function () { return testUtils.startGhost() - .then((_ghostServer) => { - ghostServer = _ghostServer; + .then(() => { request = supertest.agent(config.get('url')); }) .then(() => { diff --git a/test/regression/api/v2/admin/pages.test.js b/test/regression/api/v2/admin/pages.test.js index 69c06c8275..2e2e5786e2 100644 --- a/test/regression/api/v2/admin/pages.test.js +++ b/test/regression/api/v2/admin/pages.test.js @@ -8,7 +8,7 @@ let request; describe('Pages API', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { diff --git a/test/regression/api/v2/admin/settings.test.js b/test/regression/api/v2/admin/settings.test.js index 66ba50b475..893c904555 100644 --- a/test/regression/api/v2/admin/settings.test.js +++ b/test/regression/api/v2/admin/settings.test.js @@ -91,14 +91,12 @@ const defaultSettingsKeyTypes = [ ]; describe('Settings API (v2)', function () { - let ghostServer; let request; describe('As Owner', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { @@ -729,8 +727,7 @@ describe('Settings API (v2)', function () { describe('As Admin', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { @@ -754,8 +751,7 @@ describe('Settings API (v2)', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { @@ -815,8 +811,7 @@ describe('Settings API (v2)', function () { describe('As Author', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { diff --git a/test/regression/api/v2/admin/slack.test.js b/test/regression/api/v2/admin/slack.test.js index 7be8530792..c9b7f1011a 100644 --- a/test/regression/api/v2/admin/slack.test.js +++ b/test/regression/api/v2/admin/slack.test.js @@ -9,12 +9,9 @@ const events = require('../../../../../core/server/lib/common/events'); let request; describe('Slack API', function () { - let ghostServer; - before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { diff --git a/test/regression/api/v2/admin/users.test.js b/test/regression/api/v2/admin/users.test.js index bc4db5696d..d075f50833 100644 --- a/test/regression/api/v2/admin/users.test.js +++ b/test/regression/api/v2/admin/users.test.js @@ -9,15 +9,13 @@ let request; describe('User API', function () { let editor; let author; - let ghostServer; let otherAuthor; let admin; describe('As Owner', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { @@ -149,8 +147,7 @@ describe('User API', function () { describe('As Editor', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { @@ -229,8 +226,7 @@ describe('User API', function () { describe('As Author', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { diff --git a/test/regression/api/v2/content/authors.test.js b/test/regression/api/v2/content/authors.test.js index e9f758f4d5..001701d542 100644 --- a/test/regression/api/v2/content/authors.test.js +++ b/test/regression/api/v2/content/authors.test.js @@ -11,7 +11,7 @@ describe('Authors Content API', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { diff --git a/test/regression/api/v3/admin/authentication.test.js b/test/regression/api/v3/admin/authentication.test.js index 08fe9b68ea..264962ecef 100644 --- a/test/regression/api/v3/admin/authentication.test.js +++ b/test/regression/api/v3/admin/authentication.test.js @@ -12,13 +12,10 @@ const mailService = require('../../../../../core/server/services/mail/index'); let request; describe('Authentication API v3', function () { - let ghostServer; - describe('Blog setup', function () { before(function () { return testUtils.startGhost({forceStart: true}) - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }); }); @@ -138,8 +135,7 @@ describe('Authentication API v3', function () { describe('Invitation', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); // simulates blog setup (initialises the owner) diff --git a/test/regression/api/v3/admin/identities.test.js b/test/regression/api/v3/admin/identities.test.js index b91d03e61c..fe5b175766 100644 --- a/test/regression/api/v3/admin/identities.test.js +++ b/test/regression/api/v3/admin/identities.test.js @@ -71,7 +71,7 @@ describe('Identities API', function () { describe('As non-Owner', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { diff --git a/test/regression/api/v3/admin/members_signin_url.test.js b/test/regression/api/v3/admin/members_signin_url.test.js index cdd51acb86..f1b866a3bd 100644 --- a/test/regression/api/v3/admin/members_signin_url.test.js +++ b/test/regression/api/v3/admin/members_signin_url.test.js @@ -87,7 +87,7 @@ describe('Members Sigin URL API', function () { describe('As non-Owner and non-Admin', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { diff --git a/test/regression/api/v3/admin/notifications.test.js b/test/regression/api/v3/admin/notifications.test.js index 1fba387c74..acb3a765c3 100644 --- a/test/regression/api/v3/admin/notifications.test.js +++ b/test/regression/api/v3/admin/notifications.test.js @@ -10,7 +10,7 @@ describe('Notifications API', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { @@ -70,7 +70,7 @@ describe('Notifications API', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { @@ -118,7 +118,7 @@ describe('Notifications API', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { + .then(function () { requestEditor1 = supertest.agent(config.get('url')); requestEditor2 = supertest.agent(config.get('url')); }) diff --git a/test/regression/api/v3/admin/pages.test.js b/test/regression/api/v3/admin/pages.test.js index 69c06c8275..2e2e5786e2 100644 --- a/test/regression/api/v3/admin/pages.test.js +++ b/test/regression/api/v3/admin/pages.test.js @@ -8,7 +8,7 @@ let request; describe('Pages API', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { diff --git a/test/regression/api/v3/admin/settings.test.js b/test/regression/api/v3/admin/settings.test.js index 90f2cdd737..19f7ac4f7c 100644 --- a/test/regression/api/v3/admin/settings.test.js +++ b/test/regression/api/v3/admin/settings.test.js @@ -95,14 +95,12 @@ const defaultSettingsKeyTypes = [ ]; describe('Settings API (v3)', function () { - let ghostServer; let request; describe('As Owner', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { @@ -723,8 +721,7 @@ describe('Settings API (v3)', function () { describe('As Admin', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { @@ -748,8 +745,7 @@ describe('Settings API (v3)', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { @@ -809,8 +805,7 @@ describe('Settings API (v3)', function () { describe('As Author', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { diff --git a/test/regression/api/v3/admin/slack.test.js b/test/regression/api/v3/admin/slack.test.js index 7be8530792..c9b7f1011a 100644 --- a/test/regression/api/v3/admin/slack.test.js +++ b/test/regression/api/v3/admin/slack.test.js @@ -9,12 +9,9 @@ const events = require('../../../../../core/server/lib/common/events'); let request; describe('Slack API', function () { - let ghostServer; - before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { diff --git a/test/regression/api/v3/admin/users.test.js b/test/regression/api/v3/admin/users.test.js index bc4db5696d..d075f50833 100644 --- a/test/regression/api/v3/admin/users.test.js +++ b/test/regression/api/v3/admin/users.test.js @@ -9,15 +9,13 @@ let request; describe('User API', function () { let editor; let author; - let ghostServer; let otherAuthor; let admin; describe('As Owner', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { @@ -149,8 +147,7 @@ describe('User API', function () { describe('As Editor', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { @@ -229,8 +226,7 @@ describe('User API', function () { describe('As Author', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { diff --git a/test/regression/api/v3/content/authors.test.js b/test/regression/api/v3/content/authors.test.js index 53611a7785..b354bf4fa1 100644 --- a/test/regression/api/v3/content/authors.test.js +++ b/test/regression/api/v3/content/authors.test.js @@ -11,7 +11,7 @@ describe('Authors Content API', function () { before(function () { return testUtils.startGhost() - .then(function (_ghostServer) { + .then(function () { request = supertest.agent(config.get('url')); }) .then(function () { diff --git a/test/regression/site/dynamic_routing.test.js b/test/regression/site/dynamic_routing.test.js index 00c3732fb7..5f10aa7207 100644 --- a/test/regression/site/dynamic_routing.test.js +++ b/test/regression/site/dynamic_routing.test.js @@ -18,8 +18,6 @@ const settingsCache = require('../../../core/shared/settings-cache'); let request; describe('Dynamic Routing', function () { - let ghostServer; - function doEnd(done) { return function (err, res) { if (err) { @@ -47,8 +45,7 @@ describe('Dynamic Routing', function () { }); return testUtils.startGhost() - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }); }); @@ -290,8 +287,7 @@ describe('Dynamic Routing', function () { configUtils.set('admin:redirects', false); return testUtils.startGhost({forceStart: true}) - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }); }); @@ -300,8 +296,7 @@ describe('Dynamic Routing', function () { configUtils.restore(); return testUtils.startGhost({forceStart: true}) - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }); }); @@ -486,8 +481,7 @@ describe('Dynamic Routing', function () { configUtils.set('admin:redirects', false); return testUtils.startGhost({forceStart: true}) - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }); }); @@ -496,8 +490,7 @@ describe('Dynamic Routing', function () { configUtils.restore(); return testUtils.startGhost({forceStart: true}) - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('url')); }); }); @@ -616,7 +609,7 @@ describe('Dynamic Routing', function () { after(testUtils.teardownDb); after(function () { - return ghostServer.stop(); + return testUtils.stopGhost(); }); it('confirm current routing pattern', function (done) { diff --git a/test/regression/site/redirects.test.js b/test/regression/site/redirects.test.js index 8d7938e565..e68b6f4298 100644 --- a/test/regression/site/redirects.test.js +++ b/test/regression/site/redirects.test.js @@ -54,15 +54,12 @@ describe('Frontend Routing:Redirects', function () { redirectsFileExts.forEach((ext) => { describe(`Redirects (use redirects${ext} from test/utils/fixtures/data)`, function () { - let ghostServer; - before(function () { configUtils.set('url', 'http://localhost:2370/'); urlUtils.stubUrlUtilsFromConfig(); return testUtils.startGhost({forceStart: true, redirectsFileExt: ext}) - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('server:host') + ':' + config.get('server:port')); }); }); @@ -340,15 +337,12 @@ describe('Frontend Routing:Redirects', function () { }); describe(`Subdirectory redirects (use redirects${ext} from test/utils/fixtures/data)`, function () { - var ghostServer; - before(function () { configUtils.set('url', 'http://localhost:2370/blog/'); urlUtils.stubUrlUtilsFromConfig(); return testUtils.startGhost({forceStart: true, subdir: true, redirectsFileExt: ext}) - .then(function (_ghostServer) { - ghostServer = _ghostServer; + .then(function () { request = supertest.agent(config.get('server:host') + ':' + config.get('server:port')); }); });