From 9964a5c23a8ed4d76607c7ff825bdceb7b3dee37 Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Wed, 17 Feb 2021 16:20:55 +0000 Subject: [PATCH] Moved cacheRules from testUtils into fixtures - yet more tidy up of the huge test utils index file --- test/utils/fixtures/cache-rules.js | 7 +++++++ test/utils/index.js | 11 +++-------- 2 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 test/utils/fixtures/cache-rules.js diff --git a/test/utils/fixtures/cache-rules.js b/test/utils/fixtures/cache-rules.js new file mode 100644 index 0000000000..dba7e47032 --- /dev/null +++ b/test/utils/fixtures/cache-rules.js @@ -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' +}; diff --git a/test/utils/index.js b/test/utils/index.js index 214fd16464..6e36d3d6bd 100644 --- a/test/utils/index.js +++ b/test/utils/index.js @@ -35,6 +35,7 @@ const fixtureUtils = require('./fixture-utils'); const urlServiceUtils = require('./url-service-utils'); const oldIntegrationUtils = require('./old-integration-utils'); const redirects = require('./redirects'); +const cacheRules = require('./fixtures/cache-rules'); const context = require('./fixtures/context'); const DataGenerator = require('./fixtures/data-generator'); const filterData = require('./fixtures/filter-param'); @@ -120,7 +121,7 @@ let ghostServer; * * @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 options = _.merge({ redirectsFile: true, @@ -390,11 +391,5 @@ module.exports = { contributor: DataGenerator.Content.roles[4].id } }, - 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' - } + cacheRules: cacheRules };