mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Fixed bad setup call in settings integration test
- the setup() function returns a function that's expected to be called as a mocha hook - wrapping this in a function means it doesn't get called properly - therefore the db setup was never being called for this test
This commit is contained in:
parent
4dd2ebc78b
commit
1a6a283a50
2 changed files with 3 additions and 7 deletions
|
@ -11,9 +11,7 @@ const testUtils = require('../../utils');
|
||||||
*/
|
*/
|
||||||
|
|
||||||
describe('Settings', function () {
|
describe('Settings', function () {
|
||||||
before(function () {
|
before(testUtils.setup());
|
||||||
return testUtils.setup();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Allowlist: Only this list needs updating when a core setting is added/removed/renamed
|
// Allowlist: Only this list needs updating when a core setting is added/removed/renamed
|
||||||
const coreSettingKeys = [
|
const coreSettingKeys = [
|
||||||
|
|
|
@ -14,7 +14,6 @@ const e2eUtils = require('./e2e-utils');
|
||||||
const APIUtils = require('./api');
|
const APIUtils = require('./api');
|
||||||
const dbUtils = require('./db-utils');
|
const dbUtils = require('./db-utils');
|
||||||
const fixtureUtils = require('./fixture-utils');
|
const fixtureUtils = require('./fixture-utils');
|
||||||
const oldIntegrationUtils = require('../regression/mock-express-style/utils/setup');
|
|
||||||
const redirects = require('./redirects');
|
const redirects = require('./redirects');
|
||||||
const cacheRules = require('./fixtures/cache-rules');
|
const cacheRules = require('./fixtures/cache-rules');
|
||||||
const context = require('./fixtures/context');
|
const context = require('./fixtures/context');
|
||||||
|
@ -40,7 +39,6 @@ const initFixtures = function initFixtures() {
|
||||||
* ## Setup Integration Tests
|
* ## Setup Integration Tests
|
||||||
* Setup takes a list of arguments like: 'default', 'tag', 'perms:tag', 'perms:init'
|
* Setup takes a list of arguments like: 'default', 'tag', 'perms:tag', 'perms:init'
|
||||||
* Setup does 'init' (DB) by default
|
* Setup does 'init' (DB) by default
|
||||||
* @returns {Function}
|
|
||||||
*/
|
*/
|
||||||
const setup = function setup() {
|
const setup = function setup() {
|
||||||
/*eslint no-invalid-this: "off"*/
|
/*eslint no-invalid-this: "off"*/
|
||||||
|
@ -49,12 +47,12 @@ const setup = function setup() {
|
||||||
const args = arguments;
|
const args = arguments;
|
||||||
|
|
||||||
return function innerSetup() {
|
return function innerSetup() {
|
||||||
debug('setup start');
|
debug('Setup start');
|
||||||
models.init();
|
models.init();
|
||||||
return initFixtures
|
return initFixtures
|
||||||
.apply(self, args)
|
.apply(self, args)
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
debug('setup end');
|
debug('Setup end');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue