mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Moved cacheRules from testUtils into fixtures
- yet more tidy up of the huge test utils index file
This commit is contained in:
parent
1b4ebce3b0
commit
9964a5c23a
2 changed files with 10 additions and 8 deletions
7
test/utils/fixtures/cache-rules.js
Normal file
7
test/utils/fixtures/cache-rules.js
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
module.exports = {
|
||||||
|
public: 'public, max-age=0',
|
||||||
|
hour: 'public, max-age=' + 3600,
|
||||||
|
day: 'public, max-age=' + 86400,
|
||||||
|
year: 'public, max-age=' + 31536000,
|
||||||
|
private: 'no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0'
|
||||||
|
};
|
|
@ -35,6 +35,7 @@ const fixtureUtils = require('./fixture-utils');
|
||||||
const urlServiceUtils = require('./url-service-utils');
|
const urlServiceUtils = require('./url-service-utils');
|
||||||
const oldIntegrationUtils = require('./old-integration-utils');
|
const oldIntegrationUtils = require('./old-integration-utils');
|
||||||
const redirects = require('./redirects');
|
const redirects = require('./redirects');
|
||||||
|
const cacheRules = require('./fixtures/cache-rules');
|
||||||
const context = require('./fixtures/context');
|
const context = require('./fixtures/context');
|
||||||
const DataGenerator = require('./fixtures/data-generator');
|
const DataGenerator = require('./fixtures/data-generator');
|
||||||
const filterData = require('./fixtures/filter-param');
|
const filterData = require('./fixtures/filter-param');
|
||||||
|
@ -120,7 +121,7 @@ let ghostServer;
|
||||||
*
|
*
|
||||||
* @TODO: tidy up the tmp folders
|
* @TODO: tidy up the tmp folders
|
||||||
*/
|
*/
|
||||||
const startGhost = function startGhost(options) {
|
const startGhost = async function startGhost(options) {
|
||||||
console.time('Start Ghost'); // eslint-disable-line no-console
|
console.time('Start Ghost'); // eslint-disable-line no-console
|
||||||
options = _.merge({
|
options = _.merge({
|
||||||
redirectsFile: true,
|
redirectsFile: true,
|
||||||
|
@ -390,11 +391,5 @@ module.exports = {
|
||||||
contributor: DataGenerator.Content.roles[4].id
|
contributor: DataGenerator.Content.roles[4].id
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
cacheRules: {
|
cacheRules: cacheRules
|
||||||
public: 'public, max-age=0',
|
|
||||||
hour: 'public, max-age=' + 3600,
|
|
||||||
day: 'public, max-age=' + 86400,
|
|
||||||
year: 'public, max-age=' + 31536000,
|
|
||||||
private: 'no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0'
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue