Renamed testUtils.startGhost to localUtils.startGhost

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

- Going though local utils allows to have the "withFrontend: false" flag applied only to the e2e-api test suites. This way we can gradually introduce the no-frontend change across all test suites
This commit is contained in:
Naz 2021-11-18 12:55:35 +04:00 committed by naz
parent 9359ae923d
commit 03be383d8b
33 changed files with 37 additions and 37 deletions

View File

@ -9,7 +9,7 @@ describe('Actions API', function () {
let request;
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await localUtils.doAuth(request, 'integrations', 'api_keys');
});

View File

@ -9,7 +9,7 @@ describe('Config API', function () {
let request;
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await localUtils.doAuth(request);
});

View File

@ -10,7 +10,7 @@ describe('Custom Theme Settings API', function () {
before(async function () {
// NOTE: needs force start to be able to reinitialize Ghost process with frontend services - custom-theme-settings, to be specific
await testUtils.startGhost({
await localUtils.startGhost({
forceStart: true,
withFrontend: true
});

View File

@ -13,7 +13,7 @@ describe('DB API', function () {
let eventsTriggered;
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await localUtils.doAuth(request);
});

View File

@ -10,7 +10,7 @@ describe('Email Preview API', function () {
let request;
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await localUtils.doAuth(request, 'users:extra', 'posts');
});

View File

@ -8,7 +8,7 @@ describe('Email API', function () {
let request;
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await localUtils.doAuth(request, 'posts', 'emails');
});

View File

@ -11,7 +11,7 @@ describe('Files API', function () {
let request;
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await localUtils.doAuth(request);
});

View File

@ -11,7 +11,7 @@ describe('Images API', function () {
let request;
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await localUtils.doAuth(request);
});

View File

@ -9,7 +9,7 @@ describe('Integrations API', function () {
let request;
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await localUtils.doAuth(request, 'integrations');
});

View File

@ -10,7 +10,7 @@ describe('Invites API', function () {
let request;
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await localUtils.doAuth(request, 'invites');
});

View File

@ -9,7 +9,7 @@ describe('Admin API key authentication', function () {
let request;
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await testUtils.initFixtures('api_keys');
});
@ -84,7 +84,7 @@ describe('Admin API key authentication', function () {
});
// NOTE: need to do a full reboot to reinitialize hostSettings
await testUtils.startGhost();
await localUtils.startGhost();
await testUtils.initFixtures('api_keys');
const response = await request.get(localUtils.API.getApiQuery('posts/'))

View File

@ -3,7 +3,7 @@ const should = require('should');
const supertest = require('supertest');
const sinon = require('sinon');
const testUtils = require('../../utils');
const localUtils = require('../../regression/api/canary/admin/utils');
const localUtils = require('./utils');
const config = require('../../../core/shared/config');
describe('Labels API', function () {
@ -14,7 +14,7 @@ describe('Labels API', function () {
});
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await localUtils.doAuth(request);
});

View File

@ -10,7 +10,7 @@ describe('Mail API', function () {
let request;
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await localUtils.doAuth(request, 'invites');
});

View File

@ -12,7 +12,7 @@ describe('Media API', function () {
let request;
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await localUtils.doAuth(request);
});

View File

@ -16,7 +16,7 @@ describe('Members API', function () {
});
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await localUtils.doAuth(request, 'members', 'members:emails');
sinon.stub(labs, 'isSet').withArgs('members').returns(true);

View File

@ -8,7 +8,7 @@ describe('Notifications API', function () {
let request;
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await localUtils.doAuth(request);
});

View File

@ -13,7 +13,7 @@ describe('Oembed API', function () {
let request;
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await localUtils.doAuth(request);
});

View File

@ -10,7 +10,7 @@ describe('Pages API', function () {
let request;
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await localUtils.doAuth(request, 'users:extra', 'posts');
});

View File

@ -15,7 +15,7 @@ describe('Posts API', function () {
let request;
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await localUtils.doAuth(request, 'users:extra', 'posts', 'emails');
});
@ -387,7 +387,7 @@ describe('Posts API', function () {
});
// NOTE: need to do a full reboot to reinitialize hostSettings
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await localUtils.doAuth(request, 'users:extra', 'posts', 'emails');

View File

@ -8,7 +8,7 @@ describe('Roles API', function () {
let request;
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await localUtils.doAuth(request, 'posts');
});

View File

@ -13,7 +13,7 @@ describe('Settings API', function () {
let ghostServer;
before(async function () {
ghostServer = await testUtils.startGhost();
ghostServer = await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await localUtils.doAuth(request);
});

View File

@ -8,7 +8,7 @@ describe('Slug API', function () {
let request;
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await localUtils.doAuth(request);
});

View File

@ -14,7 +14,7 @@ describe('Snippets API', function () {
});
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await localUtils.doAuth(request, 'snippets');
});

View File

@ -8,7 +8,7 @@ describe('Tag API', function () {
let request;
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await localUtils.doAuth(request, 'posts');
});

View File

@ -26,7 +26,7 @@ describe('Themes API', function () {
};
before(async function () {
await testUtils.startGhost({
await localUtils.startGhost({
forceStart: true, // NOTE: this flag should not be here! the URL service re-initialization should be fixe instead
withFrontend: true
});

View File

@ -13,7 +13,7 @@ describe('User API', function () {
let admin;
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
// create inactive user

View File

@ -9,7 +9,7 @@ describe('Webhooks API', function () {
const API_VERSION = 'canary';
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await localUtils.doAuth(request, 'integrations');
});

View File

@ -12,7 +12,7 @@ describe('Authors Content API', function () {
let request;
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await testUtils.initFixtures('owner:post', 'users:no-owner', 'user:inactive', 'posts', 'api_keys');
});

View File

@ -9,7 +9,7 @@ describe('Content API key authentication', function () {
let request;
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await testUtils.initFixtures('api_keys');
});
@ -44,7 +44,7 @@ describe('Content API key authentication', function () {
});
// NOTE: need to do a full reboot to reinitialize hostSettings
await testUtils.startGhost();
await localUtils.startGhost();
await testUtils.initFixtures('api_keys');
const key = localUtils.getValidKey();

View File

@ -10,7 +10,7 @@ describe('Pages Content API', function () {
let request;
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await testUtils.initFixtures('users:no-owner', 'user:inactive', 'posts', 'tags:extra', 'api_keys');
});

View File

@ -13,7 +13,7 @@ describe('Posts Content API', function () {
let request;
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await testUtils.initFixtures('owner:post', 'users:no-owner', 'user:inactive', 'posts', 'tags:extra', 'api_keys');
});

View File

@ -41,7 +41,7 @@ describe('Settings Content API', function () {
let request;
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await testUtils.initFixtures('api_keys');
});

View File

@ -11,7 +11,7 @@ describe('Tags Content API', function () {
let request;
before(async function () {
await testUtils.startGhost();
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await testUtils.initFixtures('users:no-owner', 'user:inactive', 'posts', 'tags:extra', 'api_keys');
});