From 95d27e7f583ab80d385c2561dd1874236f771cff Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Wed, 6 Oct 2021 10:52:46 +0100 Subject: [PATCH] Moved frontend unit tests into their own folder - this is a small part of a bit of cleanup of our test files - the goal is to make the existing tests clearer with a view to making it easier to write more tests - this makes the test structure follow the codebase structure more closely - eventually we will colocate the frontend tests with the frontend code --- .../apps/amp/amp_components.test.js | 2 +- .../apps/amp/amp_content.test.js | 4 ++-- .../{ => frontend}/apps/amp/router.test.js | 10 +++++----- .../apps/private-blogging/controller.test.js | 6 +++--- .../private-blogging/input_password.test.js | 2 +- .../apps/private-blogging/middleware.test.js | 4 ++-- test/unit/{ => frontend}/helpers/asset.test.js | 6 +++--- .../unit/{ => frontend}/helpers/author.test.js | 6 +++--- .../{ => frontend}/helpers/authors.test.js | 8 ++++---- .../{ => frontend}/helpers/body_class.test.js | 4 ++-- .../{ => frontend}/helpers/cancel_link.test.js | 8 ++++---- .../unit/{ => frontend}/helpers/concat.test.js | 8 ++++---- .../{ => frontend}/helpers/content.test.js | 6 +++--- test/unit/{ => frontend}/helpers/date.test.js | 2 +- .../unit/{ => frontend}/helpers/encode.test.js | 2 +- .../{ => frontend}/helpers/excerpt.test.js | 2 +- .../helpers/facebook_url.test.js | 2 +- .../{ => frontend}/helpers/foreach.test.js | 4 ++-- test/unit/{ => frontend}/helpers/get.test.js | 8 ++++---- .../{ => frontend}/helpers/ghost_foot.test.js | 4 ++-- .../{ => frontend}/helpers/ghost_head.test.js | 18 +++++++++--------- test/unit/{ => frontend}/helpers/has.test.js | 2 +- .../{ => frontend}/helpers/img_url.test.js | 4 ++-- test/unit/{ => frontend}/helpers/is.test.js | 2 +- test/unit/{ => frontend}/helpers/lang.test.js | 2 +- test/unit/{ => frontend}/helpers/link.test.js | 10 +++++----- .../{ => frontend}/helpers/link_class.test.js | 8 ++++---- test/unit/{ => frontend}/helpers/match.test.js | 6 +++--- .../helpers/meta_description.test.js | 4 ++-- .../{ => frontend}/helpers/meta_title.test.js | 6 +++--- .../{ => frontend}/helpers/navigation.test.js | 16 ++++++++-------- .../{ => frontend}/helpers/next_post.test.js | 6 +++--- .../{ => frontend}/helpers/page_url.test.js | 2 +- .../{ => frontend}/helpers/pagination.test.js | 8 ++++---- .../unit/{ => frontend}/helpers/plural.test.js | 2 +- .../{ => frontend}/helpers/post_class.test.js | 2 +- .../{ => frontend}/helpers/prev_post.test.js | 6 +++--- test/unit/{ => frontend}/helpers/price.test.js | 4 ++-- test/unit/{ => frontend}/helpers/raw.test.js | 4 ++-- .../helpers/reading_time.test.js | 2 +- test/unit/{ => frontend}/helpers/t.test.js | 6 +++--- test/unit/{ => frontend}/helpers/tags.test.js | 8 ++++---- .../helpers/test_tpl/content-cta.hbs | 0 .../helpers/test_tpl/navigation.hbs | 0 .../helpers/test_tpl/pagination.hbs | 0 test/unit/{ => frontend}/helpers/title.test.js | 2 +- .../{ => frontend}/helpers/twitter_url.test.js | 2 +- test/unit/{ => frontend}/helpers/url.test.js | 12 ++++++------ test/unit/{ => frontend}/meta/amp-url.test.js | 8 ++++---- .../unit/{ => frontend}/meta/asset-url.test.js | 8 ++++---- .../{ => frontend}/meta/author-fb-url.test.js | 2 +- .../{ => frontend}/meta/author-image.test.js | 2 +- .../{ => frontend}/meta/author-url.test.js | 4 ++-- .../unit/{ => frontend}/meta/blog-logo.test.js | 4 ++-- .../{ => frontend}/meta/canonical-url.test.js | 8 ++++---- .../{ => frontend}/meta/context-object.test.js | 4 ++-- .../{ => frontend}/meta/cover-image.test.js | 2 +- .../{ => frontend}/meta/creator-url.test.js | 2 +- .../{ => frontend}/meta/description.test.js | 4 ++-- .../meta/generate-excerpt.test.js | 2 +- .../meta/image-dimensions.test.js | 2 +- test/unit/{ => frontend}/meta/keywords.test.js | 4 ++-- .../{ => frontend}/meta/modified-date.test.js | 2 +- test/unit/{ => frontend}/meta/og-image.test.js | 4 ++-- test/unit/{ => frontend}/meta/og-type.test.js | 2 +- .../{ => frontend}/meta/paginated-url.test.js | 4 ++-- .../{ => frontend}/meta/published-date.test.js | 2 +- test/unit/{ => frontend}/meta/rss-url.test.js | 4 ++-- test/unit/{ => frontend}/meta/schema.test.js | 4 ++-- .../meta/structured-data.test.js | 2 +- test/unit/{ => frontend}/meta/title.test.js | 4 ++-- .../{ => frontend}/meta/twitter-image.test.js | 4 ++-- test/unit/{ => frontend}/meta/url.test.js | 8 ++++---- .../{ => frontend}/services/apps/proxy.test.js | 6 +++--- .../services/routing/CollectionRouter.test.js | 10 +++++----- .../services/routing/ParentRouter.test.js | 8 ++++---- .../services/routing/RSSRouter.test.js | 10 +++++----- .../routing/StaticRoutesRouter.test.js | 8 ++++---- .../services/routing/TaxonomyRouter.test.js | 14 +++++++------- .../routing/controllers/channel.test.js | 8 ++++---- .../routing/controllers/collection.test.js | 10 +++++----- .../services/routing/controllers/entry.test.js | 12 ++++++------ .../routing/controllers/preview.test.js | 14 +++++++------- .../services/routing/controllers/rss.test.js | 10 +++++----- .../routing/controllers/static.test.js | 10 +++++----- .../services/routing/helpers/context.test.js | 6 +++--- .../routing/helpers/entry-lookup.test.js | 6 +++--- .../services/routing/helpers/error.test.js | 2 +- .../routing/helpers/fetch-data.test.js | 6 +++--- .../routing/helpers/format-response.test.js | 6 +++--- .../services/routing/helpers/templates.test.js | 4 ++-- .../routing/middlewares/page-param.test.js | 4 ++-- .../services/routing/registry.test.js | 2 +- .../{ => frontend}/services/rss/cache.test.js | 4 ++-- .../services/rss/generate-feed.test.js | 8 ++++---- .../services/rss/renderer.test.js | 4 ++-- .../services/sitemap/generator.test.js | 14 +++++++------- .../services/sitemap/manager.test.js | 14 +++++++------- .../services/theme-engine/active.test.js | 6 +++--- .../services/theme-engine/config.test.js | 2 +- .../theme-engine/engines/create.test.js | 2 +- .../theme-engine/handlebars/helpers.test.js | 4 ++-- .../theme-engine/handlebars/template.test.js | 2 +- .../services/theme-engine/i18n.test.js | 2 +- .../services/theme-engine/middleware.test.js | 10 +++++----- .../services/theme-engine/preview.test.js | 2 +- .../{ => frontend}/services/url/Queue.test.js | 2 +- .../services/url/UrlGenerator.test.js | 4 ++-- .../services/url/UrlService.test.js | 12 ++++++------ .../{ => frontend}/services/url/Urls.test.js | 4 ++-- 110 files changed, 295 insertions(+), 295 deletions(-) rename test/unit/{ => frontend}/apps/amp/amp_components.test.js (97%) rename test/unit/{ => frontend}/apps/amp/amp_content.test.js (98%) rename test/unit/{ => frontend}/apps/amp/router.test.js (93%) rename test/unit/{ => frontend}/apps/private-blogging/controller.test.js (90%) rename test/unit/{ => frontend}/apps/private-blogging/input_password.test.js (93%) rename test/unit/{ => frontend}/apps/private-blogging/middleware.test.js (98%) rename test/unit/{ => frontend}/helpers/asset.test.js (92%) rename test/unit/{ => frontend}/helpers/author.test.js (90%) rename test/unit/{ => frontend}/helpers/authors.test.js (97%) rename test/unit/{ => frontend}/helpers/body_class.test.js (97%) rename test/unit/{ => frontend}/helpers/cancel_link.test.js (93%) rename test/unit/{ => frontend}/helpers/concat.test.js (91%) rename test/unit/{ => frontend}/helpers/content.test.js (95%) rename test/unit/{ => frontend}/helpers/date.test.js (98%) rename test/unit/{ => frontend}/helpers/encode.test.js (85%) rename test/unit/{ => frontend}/helpers/excerpt.test.js (99%) rename test/unit/{ => frontend}/helpers/facebook_url.test.js (93%) rename test/unit/{ => frontend}/helpers/foreach.test.js (99%) rename test/unit/{ => frontend}/helpers/get.test.js (97%) rename test/unit/{ => frontend}/helpers/ghost_foot.test.js (95%) rename test/unit/{ => frontend}/helpers/ghost_head.test.js (99%) rename test/unit/{ => frontend}/helpers/has.test.js (99%) rename test/unit/{ => frontend}/helpers/img_url.test.js (98%) rename test/unit/{ => frontend}/helpers/is.test.js (96%) rename test/unit/{ => frontend}/helpers/lang.test.js (90%) rename test/unit/{ => frontend}/helpers/link.test.js (98%) rename test/unit/{ => frontend}/helpers/link_class.test.js (97%) rename test/unit/{ => frontend}/helpers/match.test.js (97%) rename test/unit/{ => frontend}/helpers/meta_description.test.js (97%) rename test/unit/{ => frontend}/helpers/meta_title.test.js (97%) rename test/unit/{ => frontend}/helpers/navigation.test.js (95%) rename test/unit/{ => frontend}/helpers/next_post.test.js (98%) rename test/unit/{ => frontend}/helpers/page_url.test.js (95%) rename test/unit/{ => frontend}/helpers/pagination.test.js (96%) rename test/unit/{ => frontend}/helpers/plural.test.js (95%) rename test/unit/{ => frontend}/helpers/post_class.test.js (95%) rename test/unit/{ => frontend}/helpers/prev_post.test.js (98%) rename test/unit/{ => frontend}/helpers/price.test.js (95%) rename test/unit/{ => frontend}/helpers/raw.test.js (86%) rename test/unit/{ => frontend}/helpers/reading_time.test.js (98%) rename test/unit/{ => frontend}/helpers/t.test.js (85%) rename test/unit/{ => frontend}/helpers/tags.test.js (97%) rename test/unit/{ => frontend}/helpers/test_tpl/content-cta.hbs (100%) rename test/unit/{ => frontend}/helpers/test_tpl/navigation.hbs (100%) rename test/unit/{ => frontend}/helpers/test_tpl/pagination.hbs (100%) rename test/unit/{ => frontend}/helpers/title.test.js (92%) rename test/unit/{ => frontend}/helpers/twitter_url.test.js (93%) rename test/unit/{ => frontend}/helpers/url.test.js (96%) rename test/unit/{ => frontend}/meta/amp-url.test.js (89%) rename test/unit/{ => frontend}/meta/asset-url.test.js (96%) rename test/unit/{ => frontend}/meta/author-fb-url.test.js (96%) rename test/unit/{ => frontend}/meta/author-image.test.js (97%) rename test/unit/{ => frontend}/meta/author-url.test.js (94%) rename test/unit/{ => frontend}/meta/blog-logo.test.js (88%) rename test/unit/{ => frontend}/meta/canonical-url.test.js (89%) rename test/unit/{ => frontend}/meta/context-object.test.js (93%) rename test/unit/{ => frontend}/meta/cover-image.test.js (96%) rename test/unit/{ => frontend}/meta/creator-url.test.js (97%) rename test/unit/{ => frontend}/meta/description.test.js (99%) rename test/unit/{ => frontend}/meta/generate-excerpt.test.js (98%) rename test/unit/{ => frontend}/meta/image-dimensions.test.js (99%) rename test/unit/{ => frontend}/meta/keywords.test.js (92%) rename test/unit/{ => frontend}/meta/modified-date.test.js (94%) rename test/unit/{ => frontend}/meta/og-image.test.js (97%) rename test/unit/{ => frontend}/meta/og-type.test.js (92%) rename test/unit/{ => frontend}/meta/paginated-url.test.js (97%) rename test/unit/{ => frontend}/meta/published-date.test.js (95%) rename test/unit/{ => frontend}/meta/rss-url.test.js (82%) rename test/unit/{ => frontend}/meta/schema.test.js (99%) rename test/unit/{ => frontend}/meta/structured-data.test.js (98%) rename test/unit/{ => frontend}/meta/title.test.js (99%) rename test/unit/{ => frontend}/meta/twitter-image.test.js (97%) rename test/unit/{ => frontend}/meta/url.test.js (96%) rename test/unit/{ => frontend}/services/apps/proxy.test.js (82%) rename test/unit/{ => frontend}/services/routing/CollectionRouter.test.js (95%) rename test/unit/{ => frontend}/services/routing/ParentRouter.test.js (97%) rename test/unit/{ => frontend}/services/routing/RSSRouter.test.js (82%) rename test/unit/{ => frontend}/services/routing/StaticRoutesRouter.test.js (97%) rename test/unit/{ => frontend}/services/routing/TaxonomyRouter.test.js (86%) rename test/unit/{ => frontend}/services/routing/controllers/channel.test.js (95%) rename test/unit/{ => frontend}/services/routing/controllers/collection.test.js (95%) rename test/unit/{ => frontend}/services/routing/controllers/entry.test.js (93%) rename test/unit/{ => frontend}/services/routing/controllers/preview.test.js (92%) rename test/unit/{ => frontend}/services/routing/controllers/rss.test.js (82%) rename test/unit/{ => frontend}/services/routing/controllers/static.test.js (88%) rename test/unit/{ => frontend}/services/routing/helpers/context.test.js (98%) rename test/unit/{ => frontend}/services/routing/helpers/entry-lookup.test.js (98%) rename test/unit/{ => frontend}/services/routing/helpers/error.test.js (92%) rename test/unit/{ => frontend}/services/routing/helpers/fetch-data.test.js (97%) rename test/unit/{ => frontend}/services/routing/helpers/format-response.test.js (95%) rename test/unit/{ => frontend}/services/routing/helpers/templates.test.js (99%) rename test/unit/{ => frontend}/services/routing/middlewares/page-param.test.js (93%) rename test/unit/{ => frontend}/services/routing/registry.test.js (95%) rename test/unit/{ => frontend}/services/rss/cache.test.js (91%) rename test/unit/{ => frontend}/services/rss/generate-feed.test.js (97%) rename test/unit/{ => frontend}/services/rss/renderer.test.js (95%) rename test/unit/{ => frontend}/services/sitemap/generator.test.js (94%) rename test/unit/{ => frontend}/services/sitemap/manager.test.js (85%) rename test/unit/{ => frontend}/services/theme-engine/active.test.js (94%) rename test/unit/{ => frontend}/services/theme-engine/config.test.js (91%) rename test/unit/{ => frontend}/services/theme-engine/engines/create.test.js (97%) rename test/unit/{ => frontend}/services/theme-engine/handlebars/helpers.test.js (90%) rename test/unit/{ => frontend}/services/theme-engine/handlebars/template.test.js (88%) rename test/unit/{ => frontend}/services/theme-engine/i18n.test.js (69%) rename test/unit/{ => frontend}/services/theme-engine/middleware.test.js (96%) rename test/unit/{ => frontend}/services/theme-engine/preview.test.js (94%) rename test/unit/{ => frontend}/services/url/Queue.test.js (98%) rename test/unit/{ => frontend}/services/url/UrlGenerator.test.js (98%) rename test/unit/{ => frontend}/services/url/UrlService.test.js (96%) rename test/unit/{ => frontend}/services/url/Urls.test.js (95%) diff --git a/test/unit/apps/amp/amp_components.test.js b/test/unit/frontend/apps/amp/amp_components.test.js similarity index 97% rename from test/unit/apps/amp/amp_components.test.js rename to test/unit/frontend/apps/amp/amp_components.test.js index c8eca6e396..7b810d58a5 100644 --- a/test/unit/apps/amp/amp_components.test.js +++ b/test/unit/frontend/apps/amp/amp_components.test.js @@ -1,7 +1,7 @@ const should = require('should'); // Stuff we are testing -const ampComponentsHelper = require('../../../../core/frontend/apps/amp/lib/helpers/amp_components'); +const ampComponentsHelper = require('../../../../../core/frontend/apps/amp/lib/helpers/amp_components'); describe('{{amp_components}} helper', function () { it('adds script tag for a gif', function () { diff --git a/test/unit/apps/amp/amp_content.test.js b/test/unit/frontend/apps/amp/amp_content.test.js similarity index 98% rename from test/unit/apps/amp/amp_content.test.js rename to test/unit/frontend/apps/amp/amp_content.test.js index fde38d438c..f2bac61daa 100644 --- a/test/unit/apps/amp/amp_content.test.js +++ b/test/unit/frontend/apps/amp/amp_content.test.js @@ -1,8 +1,8 @@ const should = require('should'); const rewire = require('rewire'); const nock = require('nock'); -const urlUtils = require('../../../utils/urlUtils'); -const ampContentHelper = rewire('../../../../core/frontend/apps/amp/lib/helpers/amp_content'); +const urlUtils = require('../../../../utils/urlUtils'); +const ampContentHelper = rewire('../../../../../core/frontend/apps/amp/lib/helpers/amp_content'); // TODO: Amperize really needs to get stubbed, so we can test returning errors // properly and make this test faster! diff --git a/test/unit/apps/amp/router.test.js b/test/unit/frontend/apps/amp/router.test.js similarity index 93% rename from test/unit/apps/amp/router.test.js rename to test/unit/frontend/apps/amp/router.test.js index 002d60eac1..9be514dcf9 100644 --- a/test/unit/apps/amp/router.test.js +++ b/test/unit/frontend/apps/amp/router.test.js @@ -2,11 +2,11 @@ const errors = require('@tryghost/errors'); const should = require('should'); const sinon = require('sinon'); const path = require('path'); -const ampController = require('../../../../core/frontend/apps/amp/lib/router'); -const urlService = require('../../../../core/frontend/services/url'); -const helpers = require('../../../../core/frontend/services/routing/helpers'); -const testUtils = require('../../../utils'); -const configUtils = require('../../../utils/configUtils'); +const ampController = require('../../../../../core/frontend/apps/amp/lib/router'); +const urlService = require('../../../../../core/frontend/services/url'); +const helpers = require('../../../../../core/frontend/services/routing/helpers'); +const testUtils = require('../../../../utils'); +const configUtils = require('../../../../utils/configUtils'); // Helper function to prevent unit tests // from failing via timeout when they diff --git a/test/unit/apps/private-blogging/controller.test.js b/test/unit/frontend/apps/private-blogging/controller.test.js similarity index 90% rename from test/unit/apps/private-blogging/controller.test.js rename to test/unit/frontend/apps/private-blogging/controller.test.js index 1821b43025..4fbe505577 100644 --- a/test/unit/apps/private-blogging/controller.test.js +++ b/test/unit/frontend/apps/private-blogging/controller.test.js @@ -1,9 +1,9 @@ const should = require('should'); const sinon = require('sinon'); const path = require('path'); -const configUtils = require('../../../utils/configUtils'); -const themeEngine = require('../../../../core/frontend/services/theme-engine'); -const privateController = require('../../../../core/frontend/apps/private-blogging/lib/router'); +const configUtils = require('../../../../utils/configUtils'); +const themeEngine = require('../../../../../core/frontend/services/theme-engine'); +const privateController = require('../../../../../core/frontend/apps/private-blogging/lib/router'); describe('Private Controller', function () { let res; diff --git a/test/unit/apps/private-blogging/input_password.test.js b/test/unit/frontend/apps/private-blogging/input_password.test.js similarity index 93% rename from test/unit/apps/private-blogging/input_password.test.js rename to test/unit/frontend/apps/private-blogging/input_password.test.js index 555097625e..9926fdb53f 100644 --- a/test/unit/apps/private-blogging/input_password.test.js +++ b/test/unit/frontend/apps/private-blogging/input_password.test.js @@ -2,7 +2,7 @@ const should = require('should'); // Stuff we are testing -const input_password = require('../../../../core/frontend/apps/private-blogging/lib/helpers/input_password'); +const input_password = require('../../../../../core/frontend/apps/private-blogging/lib/helpers/input_password'); describe('{{input_password}} helper', function () { it('has input_password helper', function () { diff --git a/test/unit/apps/private-blogging/middleware.test.js b/test/unit/frontend/apps/private-blogging/middleware.test.js similarity index 98% rename from test/unit/apps/private-blogging/middleware.test.js rename to test/unit/frontend/apps/private-blogging/middleware.test.js index 01e97c74d5..deb5e564ff 100644 --- a/test/unit/apps/private-blogging/middleware.test.js +++ b/test/unit/frontend/apps/private-blogging/middleware.test.js @@ -3,8 +3,8 @@ const should = require('should'); const sinon = require('sinon'); const crypto = require('crypto'); const fs = require('fs-extra'); -const settingsCache = require('../../../../core/shared/settings-cache'); -const privateBlogging = require('../../../../core/frontend/apps/private-blogging/lib/middleware'); +const settingsCache = require('../../../../../core/shared/settings-cache'); +const privateBlogging = require('../../../../../core/frontend/apps/private-blogging/lib/middleware'); function hash(password, salt) { const hasher = crypto.createHash('sha256'); diff --git a/test/unit/helpers/asset.test.js b/test/unit/frontend/helpers/asset.test.js similarity index 92% rename from test/unit/helpers/asset.test.js rename to test/unit/frontend/helpers/asset.test.js index 05a12f678d..c2b2c0d952 100644 --- a/test/unit/helpers/asset.test.js +++ b/test/unit/frontend/helpers/asset.test.js @@ -4,9 +4,9 @@ const should = require('should'); const sinon = require('sinon'); -const configUtils = require('../../utils/configUtils'); -const asset = require('../../../core/frontend/helpers/asset'); -const settingsCache = require('../../../core/shared/settings-cache'); +const configUtils = require('../../../utils/configUtils'); +const asset = require('../../../../core/frontend/helpers/asset'); +const settingsCache = require('../../../../core/shared/settings-cache'); describe('{{asset}} helper', function () { let rendered; diff --git a/test/unit/helpers/author.test.js b/test/unit/frontend/helpers/author.test.js similarity index 90% rename from test/unit/helpers/author.test.js rename to test/unit/frontend/helpers/author.test.js index 9938088252..f522f51168 100644 --- a/test/unit/helpers/author.test.js +++ b/test/unit/frontend/helpers/author.test.js @@ -1,8 +1,8 @@ const should = require('should'); const sinon = require('sinon'); -const testUtils = require('../../utils'); -const urlService = require('../../../core/frontend/services/url'); -const authorHelper = require('../../../core/frontend/helpers/author'); +const testUtils = require('../../../utils'); +const urlService = require('../../../../core/frontend/services/url'); +const authorHelper = require('../../../../core/frontend/helpers/author'); describe('{{author}} helper', function () { beforeEach(function () { diff --git a/test/unit/helpers/authors.test.js b/test/unit/frontend/helpers/authors.test.js similarity index 97% rename from test/unit/helpers/authors.test.js rename to test/unit/frontend/helpers/authors.test.js index 37383e4ec1..56b7a91c57 100644 --- a/test/unit/helpers/authors.test.js +++ b/test/unit/frontend/helpers/authors.test.js @@ -1,9 +1,9 @@ const should = require('should'); const sinon = require('sinon'); -const urlService = require('../../../core/frontend/services/url'); -const authorsHelper = require('../../../core/frontend/helpers/authors'); -const models = require('../../../core/server/models'); -const testUtils = require('../../utils'); +const urlService = require('../../../../core/frontend/services/url'); +const authorsHelper = require('../../../../core/frontend/helpers/authors'); +const models = require('../../../../core/server/models'); +const testUtils = require('../../../utils'); describe('{{authors}} helper', function () { before(function () { diff --git a/test/unit/helpers/body_class.test.js b/test/unit/frontend/helpers/body_class.test.js similarity index 97% rename from test/unit/helpers/body_class.test.js rename to test/unit/frontend/helpers/body_class.test.js index 178caa1a05..cecdec3fa9 100644 --- a/test/unit/helpers/body_class.test.js +++ b/test/unit/frontend/helpers/body_class.test.js @@ -1,8 +1,8 @@ const should = require('should'); -const themeList = require('../../../core/server/services/themes/list'); +const themeList = require('../../../../core/server/services/themes/list'); // Stuff we are testing -const body_class = require('../../../core/frontend/helpers/body_class'); +const body_class = require('../../../../core/frontend/helpers/body_class'); describe('{{body_class}} helper', function () { let options = {}; diff --git a/test/unit/helpers/cancel_link.test.js b/test/unit/frontend/helpers/cancel_link.test.js similarity index 93% rename from test/unit/helpers/cancel_link.test.js rename to test/unit/frontend/helpers/cancel_link.test.js index 43bf4ef985..0594cad63e 100644 --- a/test/unit/helpers/cancel_link.test.js +++ b/test/unit/frontend/helpers/cancel_link.test.js @@ -1,9 +1,9 @@ const should = require('should'); const sinon = require('sinon'); -const hbs = require('../../../core/frontend/services/theme-engine/engine'); -const cancel_link = require('../../../core/frontend/helpers/cancel_link'); -const labs = require('../../../core/shared/labs'); -const configUtils = require('../../utils/configUtils'); +const hbs = require('../../../../core/frontend/services/theme-engine/engine'); +const cancel_link = require('../../../../core/frontend/helpers/cancel_link'); +const labs = require('../../../../core/shared/labs'); +const configUtils = require('../../../utils/configUtils'); describe('{{cancel_link}} helper', function () { let labsStub; diff --git a/test/unit/helpers/concat.test.js b/test/unit/frontend/helpers/concat.test.js similarity index 91% rename from test/unit/helpers/concat.test.js rename to test/unit/frontend/helpers/concat.test.js index 02b4e2823b..7452d01f0f 100644 --- a/test/unit/helpers/concat.test.js +++ b/test/unit/frontend/helpers/concat.test.js @@ -1,10 +1,10 @@ const should = require('should'); -const handlebars = require('../../../core/frontend/services/theme-engine/engine').handlebars; +const handlebars = require('../../../../core/frontend/services/theme-engine/engine').handlebars; -const concat = require('../../../core/frontend/helpers/concat'); -const url = require('../../../core/frontend/helpers/url'); +const concat = require('../../../../core/frontend/helpers/concat'); +const url = require('../../../../core/frontend/helpers/url'); -const configUtils = require('../../utils/configUtils'); +const configUtils = require('../../../utils/configUtils'); let defaultGlobals; diff --git a/test/unit/helpers/content.test.js b/test/unit/frontend/helpers/content.test.js similarity index 95% rename from test/unit/helpers/content.test.js rename to test/unit/frontend/helpers/content.test.js index 572d57b3c6..d47ec97a60 100644 --- a/test/unit/helpers/content.test.js +++ b/test/unit/frontend/helpers/content.test.js @@ -1,10 +1,10 @@ const should = require('should'); -const hbs = require('../../../core/frontend/services/theme-engine/engine'); -const configUtils = require('../../utils/configUtils'); +const hbs = require('../../../../core/frontend/services/theme-engine/engine'); +const configUtils = require('../../../utils/configUtils'); const path = require('path'); // Stuff we are testing -const content = require('../../../core/frontend/helpers/content'); +const content = require('../../../../core/frontend/helpers/content'); describe('{{content}} helper', function () { before(function (done) { diff --git a/test/unit/helpers/date.test.js b/test/unit/frontend/helpers/date.test.js similarity index 98% rename from test/unit/helpers/date.test.js rename to test/unit/frontend/helpers/date.test.js index 5cb0bebafe..dffa4956fe 100644 --- a/test/unit/helpers/date.test.js +++ b/test/unit/frontend/helpers/date.test.js @@ -2,7 +2,7 @@ const sinon = require('sinon'); const should = require('should'); // Stuff we are testing -const date = require('../../../core/frontend/helpers/date'); +const date = require('../../../../core/frontend/helpers/date'); const moment = require('moment-timezone'); diff --git a/test/unit/helpers/encode.test.js b/test/unit/frontend/helpers/encode.test.js similarity index 85% rename from test/unit/helpers/encode.test.js rename to test/unit/frontend/helpers/encode.test.js index adb1dcdf79..1c316c8818 100644 --- a/test/unit/helpers/encode.test.js +++ b/test/unit/frontend/helpers/encode.test.js @@ -1,7 +1,7 @@ const should = require('should'); // Stuff we are testing -const encode = require('../../../core/frontend/helpers/encode'); +const encode = require('../../../../core/frontend/helpers/encode'); describe('{{encode}} helper', function () { it('can escape URI', function () { diff --git a/test/unit/helpers/excerpt.test.js b/test/unit/frontend/helpers/excerpt.test.js similarity index 99% rename from test/unit/helpers/excerpt.test.js rename to test/unit/frontend/helpers/excerpt.test.js index c65433a417..baa45305b0 100644 --- a/test/unit/helpers/excerpt.test.js +++ b/test/unit/frontend/helpers/excerpt.test.js @@ -1,7 +1,7 @@ const should = require('should'); // Stuff we are testing -const excerpt = require('../../../core/frontend/helpers/excerpt'); +const excerpt = require('../../../../core/frontend/helpers/excerpt'); describe('{{excerpt}} Helper', function () { it('renders empty string when html, excerpt, and custom_excerpt are null', function () { diff --git a/test/unit/helpers/facebook_url.test.js b/test/unit/frontend/helpers/facebook_url.test.js similarity index 93% rename from test/unit/helpers/facebook_url.test.js rename to test/unit/frontend/helpers/facebook_url.test.js index e2ae3ca46d..0674cab55c 100644 --- a/test/unit/helpers/facebook_url.test.js +++ b/test/unit/frontend/helpers/facebook_url.test.js @@ -1,7 +1,7 @@ const should = require('should'); // Stuff we are testing -const facebook_url = require('../../../core/frontend/helpers/facebook_url'); +const facebook_url = require('../../../../core/frontend/helpers/facebook_url'); describe('{{facebook_url}} helper', function () { const options = {data: {site: {}}}; diff --git a/test/unit/helpers/foreach.test.js b/test/unit/frontend/helpers/foreach.test.js similarity index 99% rename from test/unit/helpers/foreach.test.js rename to test/unit/frontend/helpers/foreach.test.js index ea3978ecf3..61e989d63c 100644 --- a/test/unit/helpers/foreach.test.js +++ b/test/unit/frontend/helpers/foreach.test.js @@ -1,8 +1,8 @@ const should = require('should'); const sinon = require('sinon'); const _ = require('lodash'); -const foreach = require('../../../core/frontend/helpers/foreach'); -const handlebars = require('../../../core/frontend/services/theme-engine/engine').handlebars; +const foreach = require('../../../../core/frontend/helpers/foreach'); +const handlebars = require('../../../../core/frontend/services/theme-engine/engine').handlebars; describe('{{#foreach}} helper', function () { let options; diff --git a/test/unit/helpers/get.test.js b/test/unit/frontend/helpers/get.test.js similarity index 97% rename from test/unit/helpers/get.test.js rename to test/unit/frontend/helpers/get.test.js index 6846b77a34..e1d25263c1 100644 --- a/test/unit/helpers/get.test.js +++ b/test/unit/frontend/helpers/get.test.js @@ -1,13 +1,13 @@ const should = require('should'); const sinon = require('sinon'); const Promise = require('bluebird'); -const {SafeString} = require('../../../core/frontend/services/rendering'); +const {SafeString} = require('../../../../core/frontend/services/rendering'); // Stuff we are testing -const get = require('../../../core/frontend/helpers/get'); +const get = require('../../../../core/frontend/helpers/get'); -const models = require('../../../core/server/models'); -const api = require('../../../core/server/api'); +const models = require('../../../../core/server/models'); +const api = require('../../../../core/server/api'); describe('{{#get}} helper', function () { let fn; diff --git a/test/unit/helpers/ghost_foot.test.js b/test/unit/frontend/helpers/ghost_foot.test.js similarity index 95% rename from test/unit/helpers/ghost_foot.test.js rename to test/unit/frontend/helpers/ghost_foot.test.js index 8c20424845..8b9c9bb717 100644 --- a/test/unit/helpers/ghost_foot.test.js +++ b/test/unit/frontend/helpers/ghost_foot.test.js @@ -1,7 +1,7 @@ const should = require('should'); const sinon = require('sinon'); -const ghost_foot = require('../../../core/frontend/helpers/ghost_foot'); -const {settingsCache} = require('../../../core/frontend/services/proxy'); +const ghost_foot = require('../../../../core/frontend/helpers/ghost_foot'); +const {settingsCache} = require('../../../../core/frontend/services/proxy'); describe('{{ghost_foot}} helper', function () { let settingsCacheStub; diff --git a/test/unit/helpers/ghost_head.test.js b/test/unit/frontend/helpers/ghost_head.test.js similarity index 99% rename from test/unit/helpers/ghost_head.test.js rename to test/unit/frontend/helpers/ghost_head.test.js index 3a0a4aa534..6ae2f652b7 100644 --- a/test/unit/helpers/ghost_head.test.js +++ b/test/unit/frontend/helpers/ghost_head.test.js @@ -4,16 +4,16 @@ const should = require('should'); const sinon = require('sinon'); const _ = require('lodash'); const moment = require('moment'); -const testUtils = require('../../utils'); -const configUtils = require('../../utils/configUtils'); -const themeEngine = require('../../../core/frontend/services/theme-engine'); -const models = require('../../../core/server/models'); -const imageLib = require('../../../core/server/lib/image'); -const routing = require('../../../core/frontend/services/routing'); -const urlService = require('../../../core/frontend/services/url'); +const testUtils = require('../../../utils'); +const configUtils = require('../../../utils/configUtils'); +const themeEngine = require('../../../../core/frontend/services/theme-engine'); +const models = require('../../../../core/server/models'); +const imageLib = require('../../../../core/server/lib/image'); +const routing = require('../../../../core/frontend/services/routing'); +const urlService = require('../../../../core/frontend/services/url'); -const ghost_head = require('../../../core/frontend/helpers/ghost_head'); -const {settingsCache} = require('../../../core/frontend/services/proxy'); +const ghost_head = require('../../../../core/frontend/helpers/ghost_head'); +const {settingsCache} = require('../../../../core/frontend/services/proxy'); describe('{{ghost_head}} helper', function () { let posts = []; diff --git a/test/unit/helpers/has.test.js b/test/unit/frontend/helpers/has.test.js similarity index 99% rename from test/unit/helpers/has.test.js rename to test/unit/frontend/helpers/has.test.js index 3726bfb1b5..55da2159dd 100644 --- a/test/unit/helpers/has.test.js +++ b/test/unit/frontend/helpers/has.test.js @@ -2,7 +2,7 @@ const should = require('should'); const sinon = require('sinon'); // Stuff we are testing -const has = require('../../../core/frontend/helpers/has'); +const has = require('../../../../core/frontend/helpers/has'); describe('{{#has}} helper', function () { let fn; diff --git a/test/unit/helpers/img_url.test.js b/test/unit/frontend/helpers/img_url.test.js similarity index 98% rename from test/unit/helpers/img_url.test.js rename to test/unit/frontend/helpers/img_url.test.js index c8a0e35a59..9a9948d239 100644 --- a/test/unit/helpers/img_url.test.js +++ b/test/unit/frontend/helpers/img_url.test.js @@ -1,9 +1,9 @@ const should = require('should'); const sinon = require('sinon'); -const configUtils = require('../../utils/configUtils'); +const configUtils = require('../../../utils/configUtils'); // Stuff we are testing -const img_url = require('../../../core/frontend/helpers/img_url'); +const img_url = require('../../../../core/frontend/helpers/img_url'); const logging = require('@tryghost/logging'); diff --git a/test/unit/helpers/is.test.js b/test/unit/frontend/helpers/is.test.js similarity index 96% rename from test/unit/helpers/is.test.js rename to test/unit/frontend/helpers/is.test.js index c5331ea8b5..edc6b8a3fa 100644 --- a/test/unit/helpers/is.test.js +++ b/test/unit/frontend/helpers/is.test.js @@ -1,5 +1,5 @@ const sinon = require('sinon'); -const is = require('../../../core/frontend/helpers/is'); +const is = require('../../../../core/frontend/helpers/is'); const logging = require('@tryghost/logging'); describe('{{#is}} helper', function () { diff --git a/test/unit/helpers/lang.test.js b/test/unit/frontend/helpers/lang.test.js similarity index 90% rename from test/unit/helpers/lang.test.js rename to test/unit/frontend/helpers/lang.test.js index 5442050ed5..814b3639cc 100644 --- a/test/unit/helpers/lang.test.js +++ b/test/unit/frontend/helpers/lang.test.js @@ -1,5 +1,5 @@ const should = require('should'); -const lang = require('../../../core/frontend/helpers/lang'); +const lang = require('../../../../core/frontend/helpers/lang'); describe('{{lang}} helper', function () { it('returns correct language tag', function () { diff --git a/test/unit/helpers/link.test.js b/test/unit/frontend/helpers/link.test.js similarity index 98% rename from test/unit/helpers/link.test.js rename to test/unit/frontend/helpers/link.test.js index ad85ad25b8..8a3ed4c00e 100644 --- a/test/unit/helpers/link.test.js +++ b/test/unit/frontend/helpers/link.test.js @@ -1,10 +1,10 @@ const should = require('should'); -const concat = require('../../../core/frontend/helpers/concat'); -const link = require('../../../core/frontend/helpers/link'); -const url = require('../../../core/frontend/helpers/url'); -const handlebars = require('../../../core/frontend/services/theme-engine/engine').handlebars; +const concat = require('../../../../core/frontend/helpers/concat'); +const link = require('../../../../core/frontend/helpers/link'); +const url = require('../../../../core/frontend/helpers/url'); +const handlebars = require('../../../../core/frontend/services/theme-engine/engine').handlebars; -const configUtils = require('../../utils/configUtils'); +const configUtils = require('../../../utils/configUtils'); let defaultGlobals; diff --git a/test/unit/helpers/link_class.test.js b/test/unit/frontend/helpers/link_class.test.js similarity index 97% rename from test/unit/helpers/link_class.test.js rename to test/unit/frontend/helpers/link_class.test.js index db625a8673..8d8c5c6d85 100644 --- a/test/unit/helpers/link_class.test.js +++ b/test/unit/frontend/helpers/link_class.test.js @@ -1,9 +1,9 @@ const should = require('should'); -const concat = require('../../../core/frontend/helpers/concat'); -const link_class = require('../../../core/frontend/helpers/link_class'); -const handlebars = require('../../../core/frontend/services/theme-engine/engine').handlebars; +const concat = require('../../../../core/frontend/helpers/concat'); +const link_class = require('../../../../core/frontend/helpers/link_class'); +const handlebars = require('../../../../core/frontend/services/theme-engine/engine').handlebars; -const configUtils = require('../../utils/configUtils'); +const configUtils = require('../../../utils/configUtils'); let defaultGlobals; diff --git a/test/unit/helpers/match.test.js b/test/unit/frontend/helpers/match.test.js similarity index 97% rename from test/unit/helpers/match.test.js rename to test/unit/frontend/helpers/match.test.js index 03c6420480..535aa1e3a4 100644 --- a/test/unit/helpers/match.test.js +++ b/test/unit/frontend/helpers/match.test.js @@ -1,9 +1,9 @@ const should = require('should'); const sinon = require('sinon'); const _ = require('lodash'); -const match = require('../../../core/frontend/helpers/match'); -const labs = require('../../../core/shared/labs'); -const handlebars = require('../../../core/frontend/services/theme-engine/engine').handlebars; +const match = require('../../../../core/frontend/helpers/match'); +const labs = require('../../../../core/shared/labs'); +const handlebars = require('../../../../core/frontend/services/theme-engine/engine').handlebars; describe('Match helper', function () { before(function () { diff --git a/test/unit/helpers/meta_description.test.js b/test/unit/frontend/helpers/meta_description.test.js similarity index 97% rename from test/unit/helpers/meta_description.test.js rename to test/unit/frontend/helpers/meta_description.test.js index b8029d7a84..be946b38fa 100644 --- a/test/unit/helpers/meta_description.test.js +++ b/test/unit/frontend/helpers/meta_description.test.js @@ -1,7 +1,7 @@ const should = require('should'); const sinon = require('sinon'); -const meta_description = require('../../../core/frontend/helpers/meta_description'); -const settingsCache = require('../../../core/shared/settings-cache'); +const meta_description = require('../../../../core/frontend/helpers/meta_description'); +const settingsCache = require('../../../../core/shared/settings-cache'); describe('{{meta_description}} helper', function () { const localSettingsCache = {}; diff --git a/test/unit/helpers/meta_title.test.js b/test/unit/frontend/helpers/meta_title.test.js similarity index 97% rename from test/unit/helpers/meta_title.test.js rename to test/unit/frontend/helpers/meta_title.test.js index 33ca0abfef..f7fb2f55ca 100644 --- a/test/unit/helpers/meta_title.test.js +++ b/test/unit/frontend/helpers/meta_title.test.js @@ -1,8 +1,8 @@ const should = require('should'); const sinon = require('sinon'); -const configUtils = require('../../utils/configUtils'); -const meta_title = require('../../../core/frontend/helpers/meta_title'); -const settingsCache = require('../../../core/shared/settings-cache'); +const configUtils = require('../../../utils/configUtils'); +const meta_title = require('../../../../core/frontend/helpers/meta_title'); +const settingsCache = require('../../../../core/shared/settings-cache'); describe('{{meta_title}} helper', function () { describe('no meta_title', function () { diff --git a/test/unit/helpers/navigation.test.js b/test/unit/frontend/helpers/navigation.test.js similarity index 95% rename from test/unit/helpers/navigation.test.js rename to test/unit/frontend/helpers/navigation.test.js index 791f7ce343..6c85b1c3e8 100644 --- a/test/unit/helpers/navigation.test.js +++ b/test/unit/frontend/helpers/navigation.test.js @@ -1,15 +1,15 @@ const should = require('should'); -const hbs = require('../../../core/frontend/services/theme-engine/engine'); -const configUtils = require('../../utils/configUtils'); +const hbs = require('../../../../core/frontend/services/theme-engine/engine'); +const configUtils = require('../../../utils/configUtils'); const path = require('path'); -const concat = require('../../../core/frontend/helpers/concat'); -const foreach = require('../../../core/frontend/helpers/foreach'); -const link_class = require('../../../core/frontend/helpers/link_class'); -const url = require('../../../core/frontend/helpers/url'); -const navigation = require('../../../core/frontend/helpers/navigation'); +const concat = require('../../../../core/frontend/helpers/concat'); +const foreach = require('../../../../core/frontend/helpers/foreach'); +const link_class = require('../../../../core/frontend/helpers/link_class'); +const url = require('../../../../core/frontend/helpers/url'); +const navigation = require('../../../../core/frontend/helpers/navigation'); -const handlebars = require('../../../core/frontend/services/theme-engine/engine').handlebars; +const handlebars = require('../../../../core/frontend/services/theme-engine/engine').handlebars; const runHelper = data => navigation.call({}, data); const runHelperThunk = data => () => runHelper(data); diff --git a/test/unit/helpers/next_post.test.js b/test/unit/frontend/helpers/next_post.test.js similarity index 98% rename from test/unit/helpers/next_post.test.js rename to test/unit/frontend/helpers/next_post.test.js index 2e4b07065b..36c24d2a7e 100644 --- a/test/unit/helpers/next_post.test.js +++ b/test/unit/frontend/helpers/next_post.test.js @@ -1,9 +1,9 @@ const errors = require('@tryghost/errors'); const sinon = require('sinon'); const Promise = require('bluebird'); -const markdownToMobiledoc = require('../../utils/fixtures/data-generator').markdownToMobiledoc; -const next_post = require('../../../core/frontend/helpers/prev_post'); -const api = require('../../../core/server/api'); +const markdownToMobiledoc = require('../../../utils/fixtures/data-generator').markdownToMobiledoc; +const next_post = require('../../../../core/frontend/helpers/prev_post'); +const api = require('../../../../core/server/api'); describe('{{next_post}} helper', function () { const apiVersion = 'canary'; diff --git a/test/unit/helpers/page_url.test.js b/test/unit/frontend/helpers/page_url.test.js similarity index 95% rename from test/unit/helpers/page_url.test.js rename to test/unit/frontend/helpers/page_url.test.js index c1551ccbb6..1ecb670307 100644 --- a/test/unit/helpers/page_url.test.js +++ b/test/unit/frontend/helpers/page_url.test.js @@ -1,7 +1,7 @@ const should = require('should'); // Stuff we are testing -const page_url = require('../../../core/frontend/helpers/page_url'); +const page_url = require('../../../../core/frontend/helpers/page_url'); describe('{{page_url}} helper', function () { const options = {data: {root: {pagination: {}}}}; diff --git a/test/unit/helpers/pagination.test.js b/test/unit/frontend/helpers/pagination.test.js similarity index 96% rename from test/unit/helpers/pagination.test.js rename to test/unit/frontend/helpers/pagination.test.js index 46430c3521..31e010f4f1 100644 --- a/test/unit/helpers/pagination.test.js +++ b/test/unit/frontend/helpers/pagination.test.js @@ -1,9 +1,9 @@ const should = require('should'); -const hbs = require('../../../core/frontend/services/theme-engine/engine'); -const configUtils = require('../../utils/configUtils'); +const hbs = require('../../../../core/frontend/services/theme-engine/engine'); +const configUtils = require('../../../utils/configUtils'); const path = require('path'); -const page_url = require('../../../core/frontend/helpers/page_url'); -const pagination = require('../../../core/frontend/helpers/pagination'); +const page_url = require('../../../../core/frontend/helpers/page_url'); +const pagination = require('../../../../core/frontend/helpers/pagination'); describe('{{pagination}} helper', function () { before(function (done) { diff --git a/test/unit/helpers/plural.test.js b/test/unit/frontend/helpers/plural.test.js similarity index 95% rename from test/unit/helpers/plural.test.js rename to test/unit/frontend/helpers/plural.test.js index 12dd2b5947..64e10504d5 100644 --- a/test/unit/helpers/plural.test.js +++ b/test/unit/frontend/helpers/plural.test.js @@ -1,7 +1,7 @@ const should = require('should'); // Stuff we are testing -const plural = require('../../../core/frontend/helpers/plural'); +const plural = require('../../../../core/frontend/helpers/plural'); describe('{{plural}} helper', function () { it('will show no-value string', function () { diff --git a/test/unit/helpers/post_class.test.js b/test/unit/frontend/helpers/post_class.test.js similarity index 95% rename from test/unit/helpers/post_class.test.js rename to test/unit/frontend/helpers/post_class.test.js index 381e6975f4..42b0ba1abc 100644 --- a/test/unit/helpers/post_class.test.js +++ b/test/unit/frontend/helpers/post_class.test.js @@ -1,7 +1,7 @@ const should = require('should'); // Stuff we are testing -const post_class = require('../../../core/frontend/helpers/post_class'); +const post_class = require('../../../../core/frontend/helpers/post_class'); describe('{{post_class}} helper', function () { it('can render class string', function () { diff --git a/test/unit/helpers/prev_post.test.js b/test/unit/frontend/helpers/prev_post.test.js similarity index 98% rename from test/unit/helpers/prev_post.test.js rename to test/unit/frontend/helpers/prev_post.test.js index 47aa8db651..a96abf02ef 100644 --- a/test/unit/helpers/prev_post.test.js +++ b/test/unit/frontend/helpers/prev_post.test.js @@ -1,9 +1,9 @@ const errors = require('@tryghost/errors'); const sinon = require('sinon'); const Promise = require('bluebird'); -const markdownToMobiledoc = require('../../utils/fixtures/data-generator').markdownToMobiledoc; -const prev_post = require('../../../core/frontend/helpers/prev_post'); -const api = require('../../../core/server/api'); +const markdownToMobiledoc = require('../../../utils/fixtures/data-generator').markdownToMobiledoc; +const prev_post = require('../../../../core/frontend/helpers/prev_post'); +const api = require('../../../../core/server/api'); describe('{{prev_post}} helper', function () { const apiVersion = 'canary'; diff --git a/test/unit/helpers/price.test.js b/test/unit/frontend/helpers/price.test.js similarity index 95% rename from test/unit/helpers/price.test.js rename to test/unit/frontend/helpers/price.test.js index 6feefcbf35..291d8572f6 100644 --- a/test/unit/helpers/price.test.js +++ b/test/unit/frontend/helpers/price.test.js @@ -1,6 +1,6 @@ const should = require('should'); -const price = require('../../../core/frontend/helpers/price'); -const handlebars = require('../../../core/frontend/services/theme-engine/engine').handlebars; +const price = require('../../../../core/frontend/helpers/price'); +const handlebars = require('../../../../core/frontend/services/theme-engine/engine').handlebars; function compile(templateString) { const template = handlebars.compile(templateString); diff --git a/test/unit/helpers/raw.test.js b/test/unit/frontend/helpers/raw.test.js similarity index 86% rename from test/unit/helpers/raw.test.js rename to test/unit/frontend/helpers/raw.test.js index 26e342dd06..bb3e6a1b39 100644 --- a/test/unit/helpers/raw.test.js +++ b/test/unit/frontend/helpers/raw.test.js @@ -1,6 +1,6 @@ const should = require('should'); -const raw = require('../../../core/frontend/helpers/raw'); -const handlebars = require('../../../core/frontend/services/theme-engine/engine').handlebars; +const raw = require('../../../../core/frontend/helpers/raw'); +const handlebars = require('../../../../core/frontend/services/theme-engine/engine').handlebars; let defaultGlobals; diff --git a/test/unit/helpers/reading_time.test.js b/test/unit/frontend/helpers/reading_time.test.js similarity index 98% rename from test/unit/helpers/reading_time.test.js rename to test/unit/frontend/helpers/reading_time.test.js index 88dd99ccaa..a1ca51f0af 100644 --- a/test/unit/helpers/reading_time.test.js +++ b/test/unit/frontend/helpers/reading_time.test.js @@ -1,7 +1,7 @@ const should = require('should'); // Stuff we are testing -const reading_time = require('../../../core/frontend/helpers/reading_time'); +const reading_time = require('../../../../core/frontend/helpers/reading_time'); const almostOneMinute = '

Ghost has a number of different user roles for your team

' + diff --git a/test/unit/helpers/t.test.js b/test/unit/frontend/helpers/t.test.js similarity index 85% rename from test/unit/helpers/t.test.js rename to test/unit/frontend/helpers/t.test.js index 3bf3e98162..d3a0b00b98 100644 --- a/test/unit/helpers/t.test.js +++ b/test/unit/frontend/helpers/t.test.js @@ -1,13 +1,13 @@ const should = require('should'); const path = require('path'); -const t = require('../../../core/frontend/helpers/t'); -const themeI18n = require('../../../core/frontend/services/theme-engine/i18n'); +const t = require('../../../../core/frontend/helpers/t'); +const themeI18n = require('../../../../core/frontend/services/theme-engine/i18n'); describe('{{t}} helper', function () { let ogBasePath = themeI18n.basePath; before(function () { - themeI18n.basePath = path.join(__dirname, '../../utils/fixtures/themes/'); + themeI18n.basePath = path.join(__dirname, '../../../utils/fixtures/themes/'); }); after(function () { diff --git a/test/unit/helpers/tags.test.js b/test/unit/frontend/helpers/tags.test.js similarity index 97% rename from test/unit/helpers/tags.test.js rename to test/unit/frontend/helpers/tags.test.js index 97d685700e..8db9456eb3 100644 --- a/test/unit/helpers/tags.test.js +++ b/test/unit/frontend/helpers/tags.test.js @@ -1,9 +1,9 @@ const should = require('should'); const sinon = require('sinon'); -const testUtils = require('../../utils'); -const urlService = require('../../../core/frontend/services/url'); -const models = require('../../../core/server/models'); -const tagsHelper = require('../../../core/frontend/helpers/tags'); +const testUtils = require('../../../utils'); +const urlService = require('../../../../core/frontend/services/url'); +const models = require('../../../../core/server/models'); +const tagsHelper = require('../../../../core/frontend/helpers/tags'); describe('{{tags}} helper', function () { before(function () { diff --git a/test/unit/helpers/test_tpl/content-cta.hbs b/test/unit/frontend/helpers/test_tpl/content-cta.hbs similarity index 100% rename from test/unit/helpers/test_tpl/content-cta.hbs rename to test/unit/frontend/helpers/test_tpl/content-cta.hbs diff --git a/test/unit/helpers/test_tpl/navigation.hbs b/test/unit/frontend/helpers/test_tpl/navigation.hbs similarity index 100% rename from test/unit/helpers/test_tpl/navigation.hbs rename to test/unit/frontend/helpers/test_tpl/navigation.hbs diff --git a/test/unit/helpers/test_tpl/pagination.hbs b/test/unit/frontend/helpers/test_tpl/pagination.hbs similarity index 100% rename from test/unit/helpers/test_tpl/pagination.hbs rename to test/unit/frontend/helpers/test_tpl/pagination.hbs diff --git a/test/unit/helpers/title.test.js b/test/unit/frontend/helpers/title.test.js similarity index 92% rename from test/unit/helpers/title.test.js rename to test/unit/frontend/helpers/title.test.js index 1a2ee5667e..94b332312e 100644 --- a/test/unit/helpers/title.test.js +++ b/test/unit/frontend/helpers/title.test.js @@ -1,7 +1,7 @@ const should = require('should'); // Stuff we are testing -const title = require('../../../core/frontend/helpers/title'); +const title = require('../../../../core/frontend/helpers/title'); describe('{{title}} Helper', function () { it('can render title', function () { diff --git a/test/unit/helpers/twitter_url.test.js b/test/unit/frontend/helpers/twitter_url.test.js similarity index 93% rename from test/unit/helpers/twitter_url.test.js rename to test/unit/frontend/helpers/twitter_url.test.js index c301ebb610..545ecb036a 100644 --- a/test/unit/helpers/twitter_url.test.js +++ b/test/unit/frontend/helpers/twitter_url.test.js @@ -1,7 +1,7 @@ const should = require('should'); // Stuff we are testing -const twitter_url = require('../../../core/frontend/helpers/twitter_url'); +const twitter_url = require('../../../../core/frontend/helpers/twitter_url'); describe('{{twitter_url}} helper', function () { const options = {data: {site: {}}}; diff --git a/test/unit/helpers/url.test.js b/test/unit/frontend/helpers/url.test.js similarity index 96% rename from test/unit/helpers/url.test.js rename to test/unit/frontend/helpers/url.test.js index f0836606cd..550a6727c5 100644 --- a/test/unit/helpers/url.test.js +++ b/test/unit/frontend/helpers/url.test.js @@ -1,13 +1,13 @@ const should = require('should'); const sinon = require('sinon'); const Promise = require('bluebird'); -const testUtils = require('../../utils'); +const testUtils = require('../../../utils'); -const configUtils = require('../../utils/configUtils'); -const markdownToMobiledoc = require('../../utils/fixtures/data-generator').markdownToMobiledoc; -const url = require('../../../core/frontend/helpers/url'); -const urlService = require('../../../core/frontend/services/url'); -const api = require('../../../core/server/api'); +const configUtils = require('../../../utils/configUtils'); +const markdownToMobiledoc = require('../../../utils/fixtures/data-generator').markdownToMobiledoc; +const url = require('../../../../core/frontend/helpers/url'); +const urlService = require('../../../../core/frontend/services/url'); +const api = require('../../../../core/server/api'); describe('{{url}} helper', function () { let rendered; diff --git a/test/unit/meta/amp-url.test.js b/test/unit/frontend/meta/amp-url.test.js similarity index 89% rename from test/unit/meta/amp-url.test.js rename to test/unit/frontend/meta/amp-url.test.js index a01678fec9..177ab3120f 100644 --- a/test/unit/meta/amp-url.test.js +++ b/test/unit/frontend/meta/amp-url.test.js @@ -1,10 +1,10 @@ const should = require('should'); const sinon = require('sinon'); const rewire = require('rewire'); -const urlUtils = require('../../../core/shared/url-utils'); -const testUtils = require('../../utils'); +const urlUtils = require('../../../../core/shared/url-utils'); +const testUtils = require('../../../utils'); -let getAmpUrl = rewire('../../../core/frontend/meta/amp-url'); +let getAmpUrl = rewire('../../../../core/frontend/meta/amp-url'); describe('getAmpUrl', function () { let getUrlStub; @@ -12,7 +12,7 @@ describe('getAmpUrl', function () { beforeEach(function () { getUrlStub = sinon.stub(); - getAmpUrl = rewire('../../../core/frontend/meta/amp-url'); + getAmpUrl = rewire('../../../../core/frontend/meta/amp-url'); getAmpUrl.__set__('getUrl', getUrlStub); sinon.stub(urlUtils, 'urlJoin'); diff --git a/test/unit/meta/asset-url.test.js b/test/unit/frontend/meta/asset-url.test.js similarity index 96% rename from test/unit/meta/asset-url.test.js rename to test/unit/frontend/meta/asset-url.test.js index a4471691b2..d4c2144c16 100644 --- a/test/unit/meta/asset-url.test.js +++ b/test/unit/frontend/meta/asset-url.test.js @@ -1,12 +1,12 @@ const should = require('should'); const sinon = require('sinon'); const rewire = require('rewire'); -const imageLib = require('../../../core/server/lib/image'); -const settingsCache = require('../../../core/shared/settings-cache'); -const configUtils = require('../../utils/configUtils'); +const imageLib = require('../../../../core/server/lib/image'); +const settingsCache = require('../../../../core/shared/settings-cache'); +const configUtils = require('../../../utils/configUtils'); const config = configUtils.config; -const getAssetUrl = rewire('../../../core/frontend/meta/asset-url'); +const getAssetUrl = rewire('../../../../core/frontend/meta/asset-url'); describe('getAssetUrl', function () { afterEach(function () { diff --git a/test/unit/meta/author-fb-url.test.js b/test/unit/frontend/meta/author-fb-url.test.js similarity index 96% rename from test/unit/meta/author-fb-url.test.js rename to test/unit/frontend/meta/author-fb-url.test.js index 525deb9045..fa2794e79a 100644 --- a/test/unit/meta/author-fb-url.test.js +++ b/test/unit/frontend/meta/author-fb-url.test.js @@ -1,5 +1,5 @@ const should = require('should'); -const getAuthorFacebookUrl = require('../../../core/frontend/meta/author-fb-url'); +const getAuthorFacebookUrl = require('../../../../core/frontend/meta/author-fb-url'); describe('getAuthorFacebookUrl', function () { it('should return author facebook url if post and has url', diff --git a/test/unit/meta/author-image.test.js b/test/unit/frontend/meta/author-image.test.js similarity index 97% rename from test/unit/meta/author-image.test.js rename to test/unit/frontend/meta/author-image.test.js index 324b4e317b..48ef04c3f9 100644 --- a/test/unit/meta/author-image.test.js +++ b/test/unit/frontend/meta/author-image.test.js @@ -1,6 +1,6 @@ const should = require('should'); const sinon = require('sinon'); -const getAuthorImage = require('../../../core/frontend/meta/author-image'); +const getAuthorImage = require('../../../../core/frontend/meta/author-image'); describe('getAuthorImage', function () { afterEach(function () { diff --git a/test/unit/meta/author-url.test.js b/test/unit/frontend/meta/author-url.test.js similarity index 94% rename from test/unit/meta/author-url.test.js rename to test/unit/frontend/meta/author-url.test.js index 93db21e0c4..9d637d16f8 100644 --- a/test/unit/meta/author-url.test.js +++ b/test/unit/frontend/meta/author-url.test.js @@ -1,8 +1,8 @@ const should = require('should'); const sinon = require('sinon'); const ObjectId = require('bson-objectid'); -const urlService = require('../../../core/frontend/services/url'); -const getAuthorUrl = require('../../../core/frontend/meta/author-url'); +const urlService = require('../../../../core/frontend/services/url'); +const getAuthorUrl = require('../../../../core/frontend/meta/author-url'); describe('getAuthorUrl', function () { beforeEach(function () { diff --git a/test/unit/meta/blog-logo.test.js b/test/unit/frontend/meta/blog-logo.test.js similarity index 88% rename from test/unit/meta/blog-logo.test.js rename to test/unit/frontend/meta/blog-logo.test.js index ec9d6c8504..b7d07b89cf 100644 --- a/test/unit/meta/blog-logo.test.js +++ b/test/unit/frontend/meta/blog-logo.test.js @@ -1,7 +1,7 @@ const should = require('should'); -const getBlogLogo = require('../../../core/frontend/meta/blog-logo'); +const getBlogLogo = require('../../../../core/frontend/meta/blog-logo'); const sinon = require('sinon'); -const settingsCache = require('../../../core/shared/settings-cache'); +const settingsCache = require('../../../../core/shared/settings-cache'); describe('getBlogLogo', function () { afterEach(function () { diff --git a/test/unit/meta/canonical-url.test.js b/test/unit/frontend/meta/canonical-url.test.js similarity index 89% rename from test/unit/meta/canonical-url.test.js rename to test/unit/frontend/meta/canonical-url.test.js index 83f4970a97..4b5f3ec792 100644 --- a/test/unit/meta/canonical-url.test.js +++ b/test/unit/frontend/meta/canonical-url.test.js @@ -1,10 +1,10 @@ const should = require('should'); const sinon = require('sinon'); const rewire = require('rewire'); -const urlUtils = require('../../../core/shared/url-utils'); -const testUtils = require('../../utils'); +const urlUtils = require('../../../../core/shared/url-utils'); +const testUtils = require('../../../utils'); -let getCanonicalUrl = rewire('../../../core/frontend/meta/canonical-url'); +let getCanonicalUrl = rewire('../../../../core/frontend/meta/canonical-url'); describe('getCanonicalUrl', function () { let getUrlStub; @@ -12,7 +12,7 @@ describe('getCanonicalUrl', function () { beforeEach(function () { getUrlStub = sinon.stub(); - getCanonicalUrl = rewire('../../../core/frontend/meta/canonical-url'); + getCanonicalUrl = rewire('../../../../core/frontend/meta/canonical-url'); getCanonicalUrl.__set__('getUrl', getUrlStub); sinon.stub(urlUtils, 'urlJoin'); diff --git a/test/unit/meta/context-object.test.js b/test/unit/frontend/meta/context-object.test.js similarity index 93% rename from test/unit/meta/context-object.test.js rename to test/unit/frontend/meta/context-object.test.js index 14bdf8b097..3d3e1249f6 100644 --- a/test/unit/meta/context-object.test.js +++ b/test/unit/frontend/meta/context-object.test.js @@ -1,7 +1,7 @@ const should = require('should'); const sinon = require('sinon'); -const getContextObject = require('../../../core/frontend/meta/context-object.js'); -const settingsCache = require('../../../core/shared/settings-cache'); +const getContextObject = require('../../../../core/frontend/meta/context-object.js'); +const settingsCache = require('../../../../core/shared/settings-cache'); describe('getContextObject', function () { let data; diff --git a/test/unit/meta/cover-image.test.js b/test/unit/frontend/meta/cover-image.test.js similarity index 96% rename from test/unit/meta/cover-image.test.js rename to test/unit/frontend/meta/cover-image.test.js index d21dba5104..5de928f4f1 100644 --- a/test/unit/meta/cover-image.test.js +++ b/test/unit/frontend/meta/cover-image.test.js @@ -1,5 +1,5 @@ const should = require('should'); -const getCoverImage = require('../../../core/frontend/meta/cover-image'); +const getCoverImage = require('../../../../core/frontend/meta/cover-image'); describe('getCoverImage', function () { it('should return absolute cover image url for home', function () { diff --git a/test/unit/meta/creator-url.test.js b/test/unit/frontend/meta/creator-url.test.js similarity index 97% rename from test/unit/meta/creator-url.test.js rename to test/unit/frontend/meta/creator-url.test.js index 2a12702e0a..4aa43223ed 100644 --- a/test/unit/meta/creator-url.test.js +++ b/test/unit/frontend/meta/creator-url.test.js @@ -1,5 +1,5 @@ const should = require('should'); -const getCreatorTwitterUrl = require('../../../core/frontend/meta/creator-url'); +const getCreatorTwitterUrl = require('../../../../core/frontend/meta/creator-url'); describe('getCreatorTwitterUrl', function () { it('should return author twitter url if post and has url', diff --git a/test/unit/meta/description.test.js b/test/unit/frontend/meta/description.test.js similarity index 99% rename from test/unit/meta/description.test.js rename to test/unit/frontend/meta/description.test.js index 311e8bee8c..bd1089f248 100644 --- a/test/unit/meta/description.test.js +++ b/test/unit/frontend/meta/description.test.js @@ -1,7 +1,7 @@ const should = require('should'); const sinon = require('sinon'); -const getMetaDescription = require('../../../core/frontend/meta/description'); -const settingsCache = require('../../../core/shared/settings-cache'); +const getMetaDescription = require('../../../../core/frontend/meta/description'); +const settingsCache = require('../../../../core/shared/settings-cache'); describe('getMetaDescription', function () { let localSettingsCache = {}; diff --git a/test/unit/meta/generate-excerpt.test.js b/test/unit/frontend/meta/generate-excerpt.test.js similarity index 98% rename from test/unit/meta/generate-excerpt.test.js rename to test/unit/frontend/meta/generate-excerpt.test.js index 2655ebbb62..a51afd8a50 100644 --- a/test/unit/meta/generate-excerpt.test.js +++ b/test/unit/frontend/meta/generate-excerpt.test.js @@ -1,5 +1,5 @@ const should = require('should'); -const generateExcerpt = require('../../../core/frontend/meta/generate-excerpt'); +const generateExcerpt = require('../../../../core/frontend/meta/generate-excerpt'); describe('generateExcerpt', function () { it('should return html excerpt with no html', function () { diff --git a/test/unit/meta/image-dimensions.test.js b/test/unit/frontend/meta/image-dimensions.test.js similarity index 99% rename from test/unit/meta/image-dimensions.test.js rename to test/unit/frontend/meta/image-dimensions.test.js index 187f35ad43..6b3fc7e1a5 100644 --- a/test/unit/meta/image-dimensions.test.js +++ b/test/unit/frontend/meta/image-dimensions.test.js @@ -1,7 +1,7 @@ const should = require('should'); const sinon = require('sinon'); const rewire = require('rewire'); -const getImageDimensions = rewire('../../../core/frontend/meta/image-dimensions'); +const getImageDimensions = rewire('../../../../core/frontend/meta/image-dimensions'); describe('getImageDimensions', function () { let sizeOfStub; diff --git a/test/unit/meta/keywords.test.js b/test/unit/frontend/meta/keywords.test.js similarity index 92% rename from test/unit/meta/keywords.test.js rename to test/unit/frontend/meta/keywords.test.js index 53ce77d532..ef0356e515 100644 --- a/test/unit/meta/keywords.test.js +++ b/test/unit/frontend/meta/keywords.test.js @@ -1,7 +1,7 @@ const should = require('should'); const sinon = require('sinon'); -const models = require('../../../core/server/models'); -const getKeywords = require('../../../core/frontend/meta/keywords'); +const models = require('../../../../core/server/models'); +const getKeywords = require('../../../../core/frontend/meta/keywords'); describe('getKeywords', function () { before(function () { diff --git a/test/unit/meta/modified-date.test.js b/test/unit/frontend/meta/modified-date.test.js similarity index 94% rename from test/unit/meta/modified-date.test.js rename to test/unit/frontend/meta/modified-date.test.js index cd8653ef75..2e94137d01 100644 --- a/test/unit/meta/modified-date.test.js +++ b/test/unit/frontend/meta/modified-date.test.js @@ -1,5 +1,5 @@ const should = require('should'); -const getModifiedDate = require('../../../core/frontend/meta/modified-date'); +const getModifiedDate = require('../../../../core/frontend/meta/modified-date'); describe('getModifiedDate', function () { it('should return updated at date as ISO 8601 from context if exists', function () { diff --git a/test/unit/meta/og-image.test.js b/test/unit/frontend/meta/og-image.test.js similarity index 97% rename from test/unit/meta/og-image.test.js rename to test/unit/frontend/meta/og-image.test.js index 85a1083ab6..fac59b83b7 100644 --- a/test/unit/meta/og-image.test.js +++ b/test/unit/frontend/meta/og-image.test.js @@ -1,7 +1,7 @@ const should = require('should'); const sinon = require('sinon'); -const getOgImage = require('../../../core/frontend/meta/og-image'); -const settingsCache = require('../../../core/shared/settings-cache'); +const getOgImage = require('../../../../core/frontend/meta/og-image'); +const settingsCache = require('../../../../core/shared/settings-cache'); describe('getOgImage', function () { let localSettingsCache = {}; diff --git a/test/unit/meta/og-type.test.js b/test/unit/frontend/meta/og-type.test.js similarity index 92% rename from test/unit/meta/og-type.test.js rename to test/unit/frontend/meta/og-type.test.js index 1f01ea9154..0d979fa7db 100644 --- a/test/unit/meta/og-type.test.js +++ b/test/unit/frontend/meta/og-type.test.js @@ -1,5 +1,5 @@ const should = require('should'); -const getOgType = require('../../../core/frontend/meta/og-type'); +const getOgType = require('../../../../core/frontend/meta/og-type'); describe('getOgType', function () { it('should return og type profile if context is type author', function () { diff --git a/test/unit/meta/paginated-url.test.js b/test/unit/frontend/meta/paginated-url.test.js similarity index 97% rename from test/unit/meta/paginated-url.test.js rename to test/unit/frontend/meta/paginated-url.test.js index 2d2e3cb69e..19df5c8368 100644 --- a/test/unit/meta/paginated-url.test.js +++ b/test/unit/frontend/meta/paginated-url.test.js @@ -1,6 +1,6 @@ const should = require('should'); -const getPaginatedUrl = require('../../../core/frontend/meta/paginated-url'); -const configUtils = require('../../utils/configUtils'); +const getPaginatedUrl = require('../../../../core/frontend/meta/paginated-url'); +const configUtils = require('../../../utils/configUtils'); describe('getPaginatedUrl', function () { let data; diff --git a/test/unit/meta/published-date.test.js b/test/unit/frontend/meta/published-date.test.js similarity index 95% rename from test/unit/meta/published-date.test.js rename to test/unit/frontend/meta/published-date.test.js index 85e692ab62..f4ef34ae82 100644 --- a/test/unit/meta/published-date.test.js +++ b/test/unit/frontend/meta/published-date.test.js @@ -1,5 +1,5 @@ const should = require('should'); -const getPublishedDate = require('../../../core/frontend/meta/published-date'); +const getPublishedDate = require('../../../../core/frontend/meta/published-date'); describe('getPublishedDate', function () { it('should return published at date as ISO 8601 from context if exists', function () { diff --git a/test/unit/meta/rss-url.test.js b/test/unit/frontend/meta/rss-url.test.js similarity index 82% rename from test/unit/meta/rss-url.test.js rename to test/unit/frontend/meta/rss-url.test.js index 0b9d507e60..9999b555fe 100644 --- a/test/unit/meta/rss-url.test.js +++ b/test/unit/frontend/meta/rss-url.test.js @@ -1,7 +1,7 @@ const should = require('should'); const sinon = require('sinon'); -const routing = require('../../../core/frontend/services/routing'); -const getRssUrl = require('../../../core/frontend/meta/rss-url'); +const routing = require('../../../../core/frontend/services/routing'); +const getRssUrl = require('../../../../core/frontend/meta/rss-url'); describe('getRssUrl', function () { beforeEach(function () { diff --git a/test/unit/meta/schema.test.js b/test/unit/frontend/meta/schema.test.js similarity index 99% rename from test/unit/meta/schema.test.js rename to test/unit/frontend/meta/schema.test.js index 17216525a6..aefb54db23 100644 --- a/test/unit/meta/schema.test.js +++ b/test/unit/frontend/meta/schema.test.js @@ -1,6 +1,6 @@ const should = require('should'); -const getSchema = require('../../../core/frontend/meta/schema'); -const markdownToMobiledoc = require('../../utils/fixtures/data-generator').markdownToMobiledoc; +const getSchema = require('../../../../core/frontend/meta/schema'); +const markdownToMobiledoc = require('../../../utils/fixtures/data-generator').markdownToMobiledoc; describe('getSchema', function () { it('should return post schema if context starts with post', function (done) { diff --git a/test/unit/meta/structured-data.test.js b/test/unit/frontend/meta/structured-data.test.js similarity index 98% rename from test/unit/meta/structured-data.test.js rename to test/unit/frontend/meta/structured-data.test.js index f44861b166..e66741b86e 100644 --- a/test/unit/meta/structured-data.test.js +++ b/test/unit/frontend/meta/structured-data.test.js @@ -1,5 +1,5 @@ const should = require('should'); -const getStructuredData = require('../../../core/frontend/meta/structured-data'); +const getStructuredData = require('../../../../core/frontend/meta/structured-data'); describe('getStructuredData', function () { it('should return structured data from metadata per post', function (done) { diff --git a/test/unit/meta/title.test.js b/test/unit/frontend/meta/title.test.js similarity index 99% rename from test/unit/meta/title.test.js rename to test/unit/frontend/meta/title.test.js index d3a31fc891..17052040ec 100644 --- a/test/unit/meta/title.test.js +++ b/test/unit/frontend/meta/title.test.js @@ -1,7 +1,7 @@ const should = require('should'); const sinon = require('sinon'); -const getTitle = require('../../../core/frontend/meta/title'); -const settingsCache = require('../../../core/shared/settings-cache'); +const getTitle = require('../../../../core/frontend/meta/title'); +const settingsCache = require('../../../../core/shared/settings-cache'); describe('getTitle', function () { let localSettingsCache = {}; diff --git a/test/unit/meta/twitter-image.test.js b/test/unit/frontend/meta/twitter-image.test.js similarity index 97% rename from test/unit/meta/twitter-image.test.js rename to test/unit/frontend/meta/twitter-image.test.js index 128ab6b19d..f08bdc5211 100644 --- a/test/unit/meta/twitter-image.test.js +++ b/test/unit/frontend/meta/twitter-image.test.js @@ -1,7 +1,7 @@ const should = require('should'); const sinon = require('sinon'); -const getTwitterImage = require('../../../core/frontend/meta/twitter-image'); -const settingsCache = require('../../../core/shared/settings-cache'); +const getTwitterImage = require('../../../../core/frontend/meta/twitter-image'); +const settingsCache = require('../../../../core/shared/settings-cache'); describe('getTwitterImage', function () { let localSettingsCache = {}; diff --git a/test/unit/meta/url.test.js b/test/unit/frontend/meta/url.test.js similarity index 96% rename from test/unit/meta/url.test.js rename to test/unit/frontend/meta/url.test.js index 639d4f974f..63a45402c7 100644 --- a/test/unit/meta/url.test.js +++ b/test/unit/frontend/meta/url.test.js @@ -1,9 +1,9 @@ const should = require('should'); const sinon = require('sinon'); -const urlUtils = require('../../../core/shared/url-utils'); -const urlService = require('../../../core/frontend/services/url'); -const getUrl = require('../../../core/frontend/meta/url'); -const testUtils = require('../../utils'); +const urlUtils = require('../../../../core/shared/url-utils'); +const urlService = require('../../../../core/frontend/services/url'); +const getUrl = require('../../../../core/frontend/meta/url'); +const testUtils = require('../../../utils'); describe('getUrl', function () { beforeEach(function () { diff --git a/test/unit/services/apps/proxy.test.js b/test/unit/frontend/services/apps/proxy.test.js similarity index 82% rename from test/unit/services/apps/proxy.test.js rename to test/unit/frontend/services/apps/proxy.test.js index b92af527b4..2410b64826 100644 --- a/test/unit/services/apps/proxy.test.js +++ b/test/unit/frontend/services/apps/proxy.test.js @@ -1,8 +1,8 @@ const should = require('should'); const sinon = require('sinon'); -const helpers = require('../../../../core/frontend/services/helpers'); -const AppProxy = require('../../../../core/frontend/services/apps/proxy'); -const routing = require('../../../../core/frontend/services/routing'); +const helpers = require('../../../../../core/frontend/services/helpers'); +const AppProxy = require('../../../../../core/frontend/services/apps/proxy'); +const routing = require('../../../../../core/frontend/services/routing'); describe('Apps', function () { beforeEach(function () { diff --git a/test/unit/services/routing/CollectionRouter.test.js b/test/unit/frontend/services/routing/CollectionRouter.test.js similarity index 95% rename from test/unit/services/routing/CollectionRouter.test.js rename to test/unit/frontend/services/routing/CollectionRouter.test.js index 48fea49e9b..ee753680f7 100644 --- a/test/unit/services/routing/CollectionRouter.test.js +++ b/test/unit/frontend/services/routing/CollectionRouter.test.js @@ -1,10 +1,10 @@ const should = require('should'); const sinon = require('sinon'); -const express = require('../../../../core/shared/express')._express; -const settingsCache = require('../../../../core/shared/settings-cache'); -const events = require('../../../../core/server/lib/common/events'); -const controllers = require('../../../../core/frontend/services/routing/controllers'); -const CollectionRouter = require('../../../../core/frontend/services/routing/CollectionRouter'); +const express = require('../../../../../core/shared/express')._express; +const settingsCache = require('../../../../../core/shared/settings-cache'); +const events = require('../../../../../core/server/lib/common/events'); +const controllers = require('../../../../../core/frontend/services/routing/controllers'); +const CollectionRouter = require('../../../../../core/frontend/services/routing/CollectionRouter'); const RESOURCE_CONFIG = {QUERY: {post: {controller: 'posts', resource: 'posts'}}}; describe('UNIT - services/routing/CollectionRouter', function () { diff --git a/test/unit/services/routing/ParentRouter.test.js b/test/unit/frontend/services/routing/ParentRouter.test.js similarity index 97% rename from test/unit/services/routing/ParentRouter.test.js rename to test/unit/frontend/services/routing/ParentRouter.test.js index f8ad7e19ad..9f3a9fc6d8 100644 --- a/test/unit/services/routing/ParentRouter.test.js +++ b/test/unit/frontend/services/routing/ParentRouter.test.js @@ -1,9 +1,9 @@ const should = require('should'); const sinon = require('sinon'); -const configUtils = require('../../../utils/configUtils'); -const events = require('../../../../core/server/lib/common/events'); -const urlUtils = require('../../../../core/shared/url-utils'); -const ParentRouter = require('../../../../core/frontend/services/routing/ParentRouter'); +const configUtils = require('../../../../utils/configUtils'); +const events = require('../../../../../core/server/lib/common/events'); +const urlUtils = require('../../../../../core/shared/url-utils'); +const ParentRouter = require('../../../../../core/frontend/services/routing/ParentRouter'); describe('UNIT - services/routing/ParentRouter', function () { let req; diff --git a/test/unit/services/routing/RSSRouter.test.js b/test/unit/frontend/services/routing/RSSRouter.test.js similarity index 82% rename from test/unit/services/routing/RSSRouter.test.js rename to test/unit/frontend/services/routing/RSSRouter.test.js index 2d29d780db..b81341fa69 100644 --- a/test/unit/services/routing/RSSRouter.test.js +++ b/test/unit/frontend/services/routing/RSSRouter.test.js @@ -1,10 +1,10 @@ const should = require('should'); const sinon = require('sinon'); -const configUtils = require('../../../utils/configUtils'); -const events = require('../../../../core/server/lib/common/events'); -const controllers = require('../../../../core/frontend/services/routing/controllers'); -const RSSRouter = require('../../../../core/frontend/services/routing/RSSRouter'); -const urlUtils = require('../../../../core/shared/url-utils'); +const configUtils = require('../../../../utils/configUtils'); +const events = require('../../../../../core/server/lib/common/events'); +const controllers = require('../../../../../core/frontend/services/routing/controllers'); +const RSSRouter = require('../../../../../core/frontend/services/routing/RSSRouter'); +const urlUtils = require('../../../../../core/shared/url-utils'); describe('UNIT - services/routing/RSSRouter', function () { describe('instantiate', function () { diff --git a/test/unit/services/routing/StaticRoutesRouter.test.js b/test/unit/frontend/services/routing/StaticRoutesRouter.test.js similarity index 97% rename from test/unit/services/routing/StaticRoutesRouter.test.js rename to test/unit/frontend/services/routing/StaticRoutesRouter.test.js index edd9ec63a4..47463707d3 100644 --- a/test/unit/services/routing/StaticRoutesRouter.test.js +++ b/test/unit/frontend/services/routing/StaticRoutesRouter.test.js @@ -1,9 +1,9 @@ const should = require('should'); const sinon = require('sinon'); -const events = require('../../../../core/server/lib/common/events'); -const controllers = require('../../../../core/frontend/services/routing/controllers'); -const StaticRoutesRouter = require('../../../../core/frontend/services/routing/StaticRoutesRouter'); -const configUtils = require('../../../utils/configUtils'); +const events = require('../../../../../core/server/lib/common/events'); +const controllers = require('../../../../../core/frontend/services/routing/controllers'); +const StaticRoutesRouter = require('../../../../../core/frontend/services/routing/StaticRoutesRouter'); +const configUtils = require('../../../../utils/configUtils'); describe('UNIT - services/routing/StaticRoutesRouter', function () { let req; diff --git a/test/unit/services/routing/TaxonomyRouter.test.js b/test/unit/frontend/services/routing/TaxonomyRouter.test.js similarity index 86% rename from test/unit/services/routing/TaxonomyRouter.test.js rename to test/unit/frontend/services/routing/TaxonomyRouter.test.js index 3d87407263..cf7f1d6537 100644 --- a/test/unit/services/routing/TaxonomyRouter.test.js +++ b/test/unit/frontend/services/routing/TaxonomyRouter.test.js @@ -1,13 +1,13 @@ const should = require('should'); const sinon = require('sinon'); const _ = require('lodash'); -const settingsCache = require('../../../../core/shared/settings-cache'); -const events = require('../../../../core/server/lib/common/events'); -const controllers = require('../../../../core/frontend/services/routing/controllers'); -const TaxonomyRouter = require('../../../../core/frontend/services/routing/TaxonomyRouter'); -const RESOURCE_CONFIG_V2 = require('../../../../core/frontend/services/routing/config/v2'); -const RESOURCE_CONFIG_CANARY = require('../../../../core/frontend/services/routing/config/canary'); -const RESOURCE_CONFIG_V3 = require('../../../../core/frontend/services/routing/config/v3'); +const settingsCache = require('../../../../../core/shared/settings-cache'); +const events = require('../../../../../core/server/lib/common/events'); +const controllers = require('../../../../../core/frontend/services/routing/controllers'); +const TaxonomyRouter = require('../../../../../core/frontend/services/routing/TaxonomyRouter'); +const RESOURCE_CONFIG_V2 = require('../../../../../core/frontend/services/routing/config/v2'); +const RESOURCE_CONFIG_CANARY = require('../../../../../core/frontend/services/routing/config/canary'); +const RESOURCE_CONFIG_V3 = require('../../../../../core/frontend/services/routing/config/v3'); describe('UNIT - services/routing/TaxonomyRouter', function () { let req; diff --git a/test/unit/services/routing/controllers/channel.test.js b/test/unit/frontend/services/routing/controllers/channel.test.js similarity index 95% rename from test/unit/services/routing/controllers/channel.test.js rename to test/unit/frontend/services/routing/controllers/channel.test.js index 6d5254892d..6f1e0f3a24 100644 --- a/test/unit/services/routing/controllers/channel.test.js +++ b/test/unit/frontend/services/routing/controllers/channel.test.js @@ -1,11 +1,11 @@ const errors = require('@tryghost/errors'); const should = require('should'); const sinon = require('sinon'); -const testUtils = require('../../../../utils'); +const testUtils = require('../../../../../utils'); const security = require('@tryghost/security'); -const themeEngine = require('../../../../../core/frontend/services/theme-engine'); -const controllers = require('../../../../../core/frontend/services/routing/controllers'); -const helpers = require('../../../../../core/frontend/services/routing/helpers'); +const themeEngine = require('../../../../../../core/frontend/services/theme-engine'); +const controllers = require('../../../../../../core/frontend/services/routing/controllers'); +const helpers = require('../../../../../../core/frontend/services/routing/helpers'); function failTest(done) { return function (err) { diff --git a/test/unit/services/routing/controllers/collection.test.js b/test/unit/frontend/services/routing/controllers/collection.test.js similarity index 95% rename from test/unit/services/routing/controllers/collection.test.js rename to test/unit/frontend/services/routing/controllers/collection.test.js index 95f0dfab12..54b42ddddc 100644 --- a/test/unit/services/routing/controllers/collection.test.js +++ b/test/unit/frontend/services/routing/controllers/collection.test.js @@ -1,12 +1,12 @@ const errors = require('@tryghost/errors'); const should = require('should'); const sinon = require('sinon'); -const testUtils = require('../../../../utils'); +const testUtils = require('../../../../../utils'); const security = require('@tryghost/security'); -const themeEngine = require('../../../../../core/frontend/services/theme-engine'); -const urlService = require('../../../../../core/frontend/services/url'); -const controllers = require('../../../../../core/frontend/services/routing/controllers'); -const helpers = require('../../../../../core/frontend/services/routing/helpers'); +const themeEngine = require('../../../../../../core/frontend/services/theme-engine'); +const urlService = require('../../../../../../core/frontend/services/url'); +const controllers = require('../../../../../../core/frontend/services/routing/controllers'); +const helpers = require('../../../../../../core/frontend/services/routing/helpers'); function failTest(done) { return function (err) { diff --git a/test/unit/services/routing/controllers/entry.test.js b/test/unit/frontend/services/routing/controllers/entry.test.js similarity index 93% rename from test/unit/services/routing/controllers/entry.test.js rename to test/unit/frontend/services/routing/controllers/entry.test.js index 980c217076..1de78fd3fb 100644 --- a/test/unit/services/routing/controllers/entry.test.js +++ b/test/unit/frontend/services/routing/controllers/entry.test.js @@ -1,11 +1,11 @@ const should = require('should'); const sinon = require('sinon'); -const testUtils = require('../../../../utils'); -const configUtils = require('../../../../utils/configUtils'); -const urlService = require('../../../../../core/frontend/services/url'); -const urlUtils = require('../../../../../core/shared/url-utils'); -const controllers = require('../../../../../core/frontend/services/routing/controllers'); -const helpers = require('../../../../../core/frontend/services/routing/helpers'); +const testUtils = require('../../../../../utils'); +const configUtils = require('../../../../../utils/configUtils'); +const urlService = require('../../../../../../core/frontend/services/url'); +const urlUtils = require('../../../../../../core/shared/url-utils'); +const controllers = require('../../../../../../core/frontend/services/routing/controllers'); +const helpers = require('../../../../../../core/frontend/services/routing/helpers'); const EDITOR_URL = `/#/editor/post/`; describe('Unit - services/routing/controllers/entry', function () { diff --git a/test/unit/services/routing/controllers/preview.test.js b/test/unit/frontend/services/routing/controllers/preview.test.js similarity index 92% rename from test/unit/services/routing/controllers/preview.test.js rename to test/unit/frontend/services/routing/controllers/preview.test.js index bbc9161580..f21cbf3c16 100644 --- a/test/unit/services/routing/controllers/preview.test.js +++ b/test/unit/frontend/services/routing/controllers/preview.test.js @@ -1,13 +1,13 @@ const should = require('should'); const sinon = require('sinon'); const Promise = require('bluebird'); -const testUtils = require('../../../../utils'); -const configUtils = require('../../../../utils/configUtils'); -const api = require('../../../../../core/server/api'); -const controllers = require('../../../../../core/frontend/services/routing/controllers'); -const helpers = require('../../../../../core/frontend/services/routing/helpers'); -const urlService = require('../../../../../core/frontend/services/url'); -const urlUtils = require('../../../../../core/shared/url-utils'); +const testUtils = require('../../../../../utils'); +const configUtils = require('../../../../../utils/configUtils'); +const api = require('../../../../../../core/server/api'); +const controllers = require('../../../../../../core/frontend/services/routing/controllers'); +const helpers = require('../../../../../../core/frontend/services/routing/helpers'); +const urlService = require('../../../../../../core/frontend/services/url'); +const urlUtils = require('../../../../../../core/shared/url-utils'); const EDITOR_URL = '/#/editor/post/'; describe('Unit - services/routing/controllers/preview', function () { diff --git a/test/unit/services/routing/controllers/rss.test.js b/test/unit/frontend/services/routing/controllers/rss.test.js similarity index 82% rename from test/unit/services/routing/controllers/rss.test.js rename to test/unit/frontend/services/routing/controllers/rss.test.js index 9975fdd30c..ecb6263491 100644 --- a/test/unit/services/routing/controllers/rss.test.js +++ b/test/unit/frontend/services/routing/controllers/rss.test.js @@ -1,10 +1,10 @@ const sinon = require('sinon'); -const testUtils = require('../../../../utils'); +const testUtils = require('../../../../../utils'); const security = require('@tryghost/security'); -const settingsCache = require('../../../../../core/shared/settings-cache'); -const controllers = require('../../../../../core/frontend/services/routing/controllers'); -const helpers = require('../../../../../core/frontend/services/routing/helpers'); -const rssService = require('../../../../../core/frontend/services/rss'); +const settingsCache = require('../../../../../../core/shared/settings-cache'); +const controllers = require('../../../../../../core/frontend/services/routing/controllers'); +const helpers = require('../../../../../../core/frontend/services/routing/helpers'); +const rssService = require('../../../../../../core/frontend/services/rss'); // Helper function to prevent unit tests // from failing via timeout when they diff --git a/test/unit/services/routing/controllers/static.test.js b/test/unit/frontend/services/routing/controllers/static.test.js similarity index 88% rename from test/unit/services/routing/controllers/static.test.js rename to test/unit/frontend/services/routing/controllers/static.test.js index 7f2e203da2..655cb9fe85 100644 --- a/test/unit/services/routing/controllers/static.test.js +++ b/test/unit/frontend/services/routing/controllers/static.test.js @@ -1,10 +1,10 @@ const should = require('should'); const sinon = require('sinon'); -const testUtils = require('../../../../utils'); -const api = require('../../../../../core/server/api'); -const themeEngine = require('../../../../../core/frontend/services/theme-engine'); -const helpers = require('../../../../../core/frontend/services/routing/helpers'); -const controllers = require('../../../../../core/frontend/services/routing/controllers'); +const testUtils = require('../../../../../utils'); +const api = require('../../../../../../core/server/api'); +const themeEngine = require('../../../../../../core/frontend/services/theme-engine'); +const helpers = require('../../../../../../core/frontend/services/routing/helpers'); +const controllers = require('../../../../../../core/frontend/services/routing/controllers'); function failTest(done) { return function (err) { diff --git a/test/unit/services/routing/helpers/context.test.js b/test/unit/frontend/services/routing/helpers/context.test.js similarity index 98% rename from test/unit/services/routing/helpers/context.test.js rename to test/unit/frontend/services/routing/helpers/context.test.js index f6ab2cc59d..86e9e57228 100644 --- a/test/unit/services/routing/helpers/context.test.js +++ b/test/unit/frontend/services/routing/helpers/context.test.js @@ -1,9 +1,9 @@ const should = require('should'); const sinon = require('sinon'); const _ = require('lodash'); -const testUtils = require('../../../../utils'); -const helpers = require('../../../../../core/frontend/services/routing/helpers'); -const labs = require('../../../../../core/shared/labs'); +const testUtils = require('../../../../../utils'); +const helpers = require('../../../../../../core/frontend/services/routing/helpers'); +const labs = require('../../../../../../core/shared/labs'); describe('Contexts', function () { let req; diff --git a/test/unit/services/routing/helpers/entry-lookup.test.js b/test/unit/frontend/services/routing/helpers/entry-lookup.test.js similarity index 98% rename from test/unit/services/routing/helpers/entry-lookup.test.js rename to test/unit/frontend/services/routing/helpers/entry-lookup.test.js index 5828791665..9d791ce63e 100644 --- a/test/unit/services/routing/helpers/entry-lookup.test.js +++ b/test/unit/frontend/services/routing/helpers/entry-lookup.test.js @@ -1,9 +1,9 @@ const should = require('should'); const sinon = require('sinon'); const Promise = require('bluebird'); -const testUtils = require('../../../../utils'); -const api = require('../../../../../core/server/api'); -const helpers = require('../../../../../core/frontend/services/routing/helpers'); +const testUtils = require('../../../../../utils'); +const api = require('../../../../../../core/server/api'); +const helpers = require('../../../../../../core/frontend/services/routing/helpers'); describe('Unit - services/routing/helpers/entry-lookup', function () { let locals; diff --git a/test/unit/services/routing/helpers/error.test.js b/test/unit/frontend/services/routing/helpers/error.test.js similarity index 92% rename from test/unit/services/routing/helpers/error.test.js rename to test/unit/frontend/services/routing/helpers/error.test.js index 9e5f52ef1d..2631d1e065 100644 --- a/test/unit/services/routing/helpers/error.test.js +++ b/test/unit/frontend/services/routing/helpers/error.test.js @@ -1,7 +1,7 @@ const should = require('should'); const sinon = require('sinon'); const errors = require('@tryghost/errors'); -const helpers = require('../../../../../core/frontend/services/routing/helpers'); +const helpers = require('../../../../../../core/frontend/services/routing/helpers'); describe('handleError', function () { let next; diff --git a/test/unit/services/routing/helpers/fetch-data.test.js b/test/unit/frontend/services/routing/helpers/fetch-data.test.js similarity index 97% rename from test/unit/services/routing/helpers/fetch-data.test.js rename to test/unit/frontend/services/routing/helpers/fetch-data.test.js index e504536bd7..9beda38540 100644 --- a/test/unit/services/routing/helpers/fetch-data.test.js +++ b/test/unit/frontend/services/routing/helpers/fetch-data.test.js @@ -1,8 +1,8 @@ const should = require('should'); const sinon = require('sinon'); -const api = require('../../../../../core/server/api').v2; -const helpers = require('../../../../../core/frontend/services/routing/helpers'); -const testUtils = require('../../../../utils'); +const api = require('../../../../../../core/server/api').v2; +const helpers = require('../../../../../../core/frontend/services/routing/helpers'); +const testUtils = require('../../../../../utils'); describe('Unit - services/routing/helpers/fetch-data', function () { let posts; diff --git a/test/unit/services/routing/helpers/format-response.test.js b/test/unit/frontend/services/routing/helpers/format-response.test.js similarity index 95% rename from test/unit/services/routing/helpers/format-response.test.js rename to test/unit/frontend/services/routing/helpers/format-response.test.js index 4ed5f0a790..de5cbbb816 100644 --- a/test/unit/services/routing/helpers/format-response.test.js +++ b/test/unit/frontend/services/routing/helpers/format-response.test.js @@ -1,7 +1,7 @@ const should = require('should'); -const testUtils = require('../../../../utils'); -const helpers = require('../../../../../core/frontend/services/routing/helpers'); -const {SafeString} = require('../../../../../core/frontend/services/rendering'); +const testUtils = require('../../../../../utils'); +const helpers = require('../../../../../../core/frontend/services/routing/helpers'); +const {SafeString} = require('../../../../../../core/frontend/services/rendering'); describe('Unit - services/routing/helpers/format-response', function () { let posts; diff --git a/test/unit/services/routing/helpers/templates.test.js b/test/unit/frontend/services/routing/helpers/templates.test.js similarity index 99% rename from test/unit/services/routing/helpers/templates.test.js rename to test/unit/frontend/services/routing/helpers/templates.test.js index d2ac952ff5..c12f5f48b8 100644 --- a/test/unit/services/routing/helpers/templates.test.js +++ b/test/unit/frontend/services/routing/helpers/templates.test.js @@ -1,8 +1,8 @@ const should = require('should'); const sinon = require('sinon'); const rewire = require('rewire'); -const templates = rewire('../../../../../core/frontend/services/routing/helpers/templates'); -const themeEngine = require('../../../../../core/frontend/services/theme-engine'); +const templates = rewire('../../../../../../core/frontend/services/routing/helpers/templates'); +const themeEngine = require('../../../../../../core/frontend/services/theme-engine'); describe('templates', function () { let getActiveThemeStub; diff --git a/test/unit/services/routing/middlewares/page-param.test.js b/test/unit/frontend/services/routing/middlewares/page-param.test.js similarity index 93% rename from test/unit/services/routing/middlewares/page-param.test.js rename to test/unit/frontend/services/routing/middlewares/page-param.test.js index 326bb03f5a..d423d7a53d 100644 --- a/test/unit/services/routing/middlewares/page-param.test.js +++ b/test/unit/frontend/services/routing/middlewares/page-param.test.js @@ -1,8 +1,8 @@ const should = require('should'); const sinon = require('sinon'); const errors = require('@tryghost/errors'); -const urlUtils = require('../../../../../core/shared/url-utils'); -const middlewares = require('../../../../../core/frontend/services/routing/middlewares'); +const urlUtils = require('../../../../../../core/shared/url-utils'); +const middlewares = require('../../../../../../core/frontend/services/routing/middlewares'); describe('UNIT: services/routing/middlewares/page-param', function () { let req; diff --git a/test/unit/services/routing/registry.test.js b/test/unit/frontend/services/routing/registry.test.js similarity index 95% rename from test/unit/services/routing/registry.test.js rename to test/unit/frontend/services/routing/registry.test.js index 6d1a066eea..8a6efa9cfb 100644 --- a/test/unit/services/routing/registry.test.js +++ b/test/unit/frontend/services/routing/registry.test.js @@ -1,7 +1,7 @@ const should = require('should'); const sinon = require('sinon'); const rewire = require('rewire'); -const registry = rewire('../../../../core/frontend/services/routing/registry'); +const registry = rewire('../../../../../core/frontend/services/routing/registry'); describe('UNIT: services/routing/registry', function () { let getRssUrlStub; diff --git a/test/unit/services/rss/cache.test.js b/test/unit/frontend/services/rss/cache.test.js similarity index 91% rename from test/unit/services/rss/cache.test.js rename to test/unit/frontend/services/rss/cache.test.js index 3d772f8590..91fbb75d37 100644 --- a/test/unit/services/rss/cache.test.js +++ b/test/unit/frontend/services/rss/cache.test.js @@ -1,8 +1,8 @@ const should = require('should'); const sinon = require('sinon'); const rewire = require('rewire'); -const configUtils = require('../../../utils/configUtils'); -const rssCache = rewire('../../../../core/frontend/services/rss/cache'); +const configUtils = require('../../../../utils/configUtils'); +const rssCache = rewire('../../../../../core/frontend/services/rss/cache'); describe('RSS: Cache', function () { let generateSpy; diff --git a/test/unit/services/rss/generate-feed.test.js b/test/unit/frontend/services/rss/generate-feed.test.js similarity index 97% rename from test/unit/services/rss/generate-feed.test.js rename to test/unit/frontend/services/rss/generate-feed.test.js index 1154724a5e..8a2e37e088 100644 --- a/test/unit/services/rss/generate-feed.test.js +++ b/test/unit/frontend/services/rss/generate-feed.test.js @@ -1,10 +1,10 @@ const should = require('should'); const sinon = require('sinon'); const _ = require('lodash'); -const testUtils = require('../../../utils'); -const configUtils = require('../../../utils/configUtils'); -const urlService = require('../../../../core/frontend/services/url'); -const generateFeed = require('../../../../core/frontend/services/rss/generate-feed'); +const testUtils = require('../../../../utils'); +const configUtils = require('../../../../utils/configUtils'); +const urlService = require('../../../../../core/frontend/services/url'); +const generateFeed = require('../../../../../core/frontend/services/rss/generate-feed'); describe('RSS: Generate Feed', function () { const data = {}; diff --git a/test/unit/services/rss/renderer.test.js b/test/unit/frontend/services/rss/renderer.test.js similarity index 95% rename from test/unit/services/rss/renderer.test.js rename to test/unit/frontend/services/rss/renderer.test.js index 9f031ac041..f800696b62 100644 --- a/test/unit/services/rss/renderer.test.js +++ b/test/unit/frontend/services/rss/renderer.test.js @@ -1,8 +1,8 @@ const should = require('should'); const sinon = require('sinon'); const Promise = require('bluebird'); -const rssCache = require('../../../../core/frontend/services/rss/cache'); -const renderer = require('../../../../core/frontend/services/rss/renderer'); +const rssCache = require('../../../../../core/frontend/services/rss/cache'); +const renderer = require('../../../../../core/frontend/services/rss/renderer'); describe('RSS: Renderer', function () { let rssCacheStub; diff --git a/test/unit/services/sitemap/generator.test.js b/test/unit/frontend/services/sitemap/generator.test.js similarity index 94% rename from test/unit/services/sitemap/generator.test.js rename to test/unit/frontend/services/sitemap/generator.test.js index 54968e3d4e..177fb3c513 100644 --- a/test/unit/services/sitemap/generator.test.js +++ b/test/unit/frontend/services/sitemap/generator.test.js @@ -2,13 +2,13 @@ const should = require('should'); const sinon = require('sinon'); const ObjectId = require('bson-objectid'); const _ = require('lodash'); -const testUtils = require('../../../utils'); -const urlUtils = require('../../../../core/shared/url-utils'); -const IndexGenerator = require('../../../../core/frontend/services/sitemap/index-generator'); -const PostGenerator = require('../../../../core/frontend/services/sitemap/post-generator'); -const PageGenerator = require('../../../../core/frontend/services/sitemap/page-generator'); -const TagGenerator = require('../../../../core/frontend/services/sitemap/tag-generator'); -const UserGenerator = require('../../../../core/frontend/services/sitemap/user-generator'); +const testUtils = require('../../../../utils'); +const urlUtils = require('../../../../../core/shared/url-utils'); +const IndexGenerator = require('../../../../../core/frontend/services/sitemap/index-generator'); +const PostGenerator = require('../../../../../core/frontend/services/sitemap/post-generator'); +const PageGenerator = require('../../../../../core/frontend/services/sitemap/page-generator'); +const TagGenerator = require('../../../../../core/frontend/services/sitemap/tag-generator'); +const UserGenerator = require('../../../../../core/frontend/services/sitemap/user-generator'); should.Assertion.add('ValidUrlNode', function (options) { // Check urlNode looks correct diff --git a/test/unit/services/sitemap/manager.test.js b/test/unit/frontend/services/sitemap/manager.test.js similarity index 85% rename from test/unit/services/sitemap/manager.test.js rename to test/unit/frontend/services/sitemap/manager.test.js index b1958cfe7b..224726ece7 100644 --- a/test/unit/services/sitemap/manager.test.js +++ b/test/unit/frontend/services/sitemap/manager.test.js @@ -2,14 +2,14 @@ const should = require('should'); const sinon = require('sinon'); // Stuff we are testing -const events = require('../../../../core/server/lib/common/events'); +const events = require('../../../../../core/server/lib/common/events'); -const SiteMapManager = require('../../../../core/frontend/services/sitemap/manager'); -const PostGenerator = require('../../../../core/frontend/services/sitemap/post-generator'); -const PageGenerator = require('../../../../core/frontend/services/sitemap/page-generator'); -const TagGenerator = require('../../../../core/frontend/services/sitemap/tag-generator'); -const UserGenerator = require('../../../../core/frontend/services/sitemap/user-generator'); -const IndexGenerator = require('../../../../core/frontend/services/sitemap/index-generator'); +const SiteMapManager = require('../../../../../core/frontend/services/sitemap/manager'); +const PostGenerator = require('../../../../../core/frontend/services/sitemap/post-generator'); +const PageGenerator = require('../../../../../core/frontend/services/sitemap/page-generator'); +const TagGenerator = require('../../../../../core/frontend/services/sitemap/tag-generator'); +const UserGenerator = require('../../../../../core/frontend/services/sitemap/user-generator'); +const IndexGenerator = require('../../../../../core/frontend/services/sitemap/index-generator'); describe('Unit: sitemap/manager', function () { let eventsToRemember; diff --git a/test/unit/services/theme-engine/active.test.js b/test/unit/frontend/services/theme-engine/active.test.js similarity index 94% rename from test/unit/services/theme-engine/active.test.js rename to test/unit/frontend/services/theme-engine/active.test.js index 490b68132c..f7b9ad9a3b 100644 --- a/test/unit/services/theme-engine/active.test.js +++ b/test/unit/frontend/services/theme-engine/active.test.js @@ -1,10 +1,10 @@ const should = require('should'); const sinon = require('sinon'); -const config = require('../../../../core/shared/config'); +const config = require('../../../../../core/shared/config'); // is only exposed via themeEngine.getActive() -const activeTheme = require('../../../../core/frontend/services/theme-engine/active'); -const engine = require('../../../../core/frontend/services/theme-engine/engine'); +const activeTheme = require('../../../../../core/frontend/services/theme-engine/active'); +const engine = require('../../../../../core/frontend/services/theme-engine/engine'); describe('Themes', function () { afterEach(function () { diff --git a/test/unit/services/theme-engine/config.test.js b/test/unit/frontend/services/theme-engine/config.test.js similarity index 91% rename from test/unit/services/theme-engine/config.test.js rename to test/unit/frontend/services/theme-engine/config.test.js index 30fa412838..c7591e3cdd 100644 --- a/test/unit/services/theme-engine/config.test.js +++ b/test/unit/frontend/services/theme-engine/config.test.js @@ -1,6 +1,6 @@ const should = require('should'); const sinon = require('sinon'); -const themeConfig = require('../../../../core/frontend/services/theme-engine/config'); +const themeConfig = require('../../../../../core/frontend/services/theme-engine/config'); describe('Themes', function () { afterEach(function () { diff --git a/test/unit/services/theme-engine/engines/create.test.js b/test/unit/frontend/services/theme-engine/engines/create.test.js similarity index 97% rename from test/unit/services/theme-engine/engines/create.test.js rename to test/unit/frontend/services/theme-engine/engines/create.test.js index 95c5d1712e..eba63a677c 100644 --- a/test/unit/services/theme-engine/engines/create.test.js +++ b/test/unit/frontend/services/theme-engine/engines/create.test.js @@ -1,6 +1,6 @@ const should = require('should'); const sinon = require('sinon'); -const themeEngines = require('../../../../../core/frontend/services/theme-engine/engines'); +const themeEngines = require('../../../../../../core/frontend/services/theme-engine/engines'); /** * @NOTE diff --git a/test/unit/services/theme-engine/handlebars/helpers.test.js b/test/unit/frontend/services/theme-engine/handlebars/helpers.test.js similarity index 90% rename from test/unit/services/theme-engine/handlebars/helpers.test.js rename to test/unit/frontend/services/theme-engine/handlebars/helpers.test.js index 1ec00390be..1ebe102729 100644 --- a/test/unit/services/theme-engine/handlebars/helpers.test.js +++ b/test/unit/frontend/services/theme-engine/handlebars/helpers.test.js @@ -1,9 +1,9 @@ const should = require('should'); const _ = require('lodash'); -const hbs = require('../../../../../core/frontend/services/theme-engine/engine'); +const hbs = require('../../../../../../core/frontend/services/theme-engine/engine'); // Stuff we are testing -const helpers = require('../../../../../core/frontend/services/helpers'); +const helpers = require('../../../../../../core/frontend/services/helpers'); describe('Helpers', function () { const hbsHelpers = ['each', 'if', 'unless', 'with', 'helperMissing', 'blockHelperMissing', 'log', 'lookup', 'block', 'contentFor']; diff --git a/test/unit/services/theme-engine/handlebars/template.test.js b/test/unit/frontend/services/theme-engine/handlebars/template.test.js similarity index 88% rename from test/unit/services/theme-engine/handlebars/template.test.js rename to test/unit/frontend/services/theme-engine/handlebars/template.test.js index 9811e84ef9..bfb479b041 100644 --- a/test/unit/services/theme-engine/handlebars/template.test.js +++ b/test/unit/frontend/services/theme-engine/handlebars/template.test.js @@ -1,6 +1,6 @@ const should = require('should'); const errors = require('@tryghost/errors'); -const {hbs, templates} = require('../../../../../core/frontend/services/rendering'); +const {hbs, templates} = require('../../../../../../core/frontend/services/rendering'); describe('Helpers Template', function () { it('can execute a template', function () { diff --git a/test/unit/services/theme-engine/i18n.test.js b/test/unit/frontend/services/theme-engine/i18n.test.js similarity index 69% rename from test/unit/services/theme-engine/i18n.test.js rename to test/unit/frontend/services/theme-engine/i18n.test.js index 9199eb2662..58b3af62fe 100644 --- a/test/unit/services/theme-engine/i18n.test.js +++ b/test/unit/frontend/services/theme-engine/i18n.test.js @@ -1,6 +1,6 @@ const should = require('should'); -const ThemeI18n = require('../../../../core/frontend/services/theme-engine/i18n').ThemeI18n; +const ThemeI18n = require('../../../../../core/frontend/services/theme-engine/i18n').ThemeI18n; describe('ThemeI18n Class Behaviour', function () { it('defaults to en', function () { diff --git a/test/unit/services/theme-engine/middleware.test.js b/test/unit/frontend/services/theme-engine/middleware.test.js similarity index 96% rename from test/unit/services/theme-engine/middleware.test.js rename to test/unit/frontend/services/theme-engine/middleware.test.js index e4961f1577..415e298d9b 100644 --- a/test/unit/services/theme-engine/middleware.test.js +++ b/test/unit/frontend/services/theme-engine/middleware.test.js @@ -1,11 +1,11 @@ const should = require('should'); const sinon = require('sinon'); -const hbs = require('../../../../core/frontend/services/theme-engine/engine'); -const middleware = require('../../../../core/frontend/services/theme-engine').middleware; +const hbs = require('../../../../../core/frontend/services/theme-engine/engine'); +const middleware = require('../../../../../core/frontend/services/theme-engine').middleware; // is only exposed via themeEngine.getActive() -const activeTheme = require('../../../../core/frontend/services/theme-engine/active'); -const settingsCache = require('../../../../core/shared/settings-cache'); -const customThemeSettingsCache = require('../../../../core/shared/custom-theme-settings-cache'); +const activeTheme = require('../../../../../core/frontend/services/theme-engine/active'); +const settingsCache = require('../../../../../core/shared/settings-cache'); +const customThemeSettingsCache = require('../../../../../core/shared/custom-theme-settings-cache'); const sandbox = sinon.createSandbox(); diff --git a/test/unit/services/theme-engine/preview.test.js b/test/unit/frontend/services/theme-engine/preview.test.js similarity index 94% rename from test/unit/services/theme-engine/preview.test.js rename to test/unit/frontend/services/theme-engine/preview.test.js index 5809e2621e..326232d4e7 100644 --- a/test/unit/services/theme-engine/preview.test.js +++ b/test/unit/frontend/services/theme-engine/preview.test.js @@ -1,7 +1,7 @@ const should = require('should'); const sinon = require('sinon'); -const preview = require('../../../../core/frontend/services/theme-engine/preview'); +const preview = require('../../../../../core/frontend/services/theme-engine/preview'); describe('Theme Preview', function () { let req, previewString = ''; diff --git a/test/unit/services/url/Queue.test.js b/test/unit/frontend/services/url/Queue.test.js similarity index 98% rename from test/unit/services/url/Queue.test.js rename to test/unit/frontend/services/url/Queue.test.js index 6401e12fd5..de534c996b 100644 --- a/test/unit/services/url/Queue.test.js +++ b/test/unit/frontend/services/url/Queue.test.js @@ -2,7 +2,7 @@ const _ = require('lodash'); const should = require('should'); const sinon = require('sinon'); const logging = require('@tryghost/logging'); -const Queue = require('../../../../core/frontend/services/url/Queue'); +const Queue = require('../../../../../core/frontend/services/url/Queue'); describe('Unit: services/url/Queue', function () { let queue; diff --git a/test/unit/services/url/UrlGenerator.test.js b/test/unit/frontend/services/url/UrlGenerator.test.js similarity index 98% rename from test/unit/services/url/UrlGenerator.test.js rename to test/unit/frontend/services/url/UrlGenerator.test.js index ea9f815f1e..662aa88be7 100644 --- a/test/unit/services/url/UrlGenerator.test.js +++ b/test/unit/frontend/services/url/UrlGenerator.test.js @@ -1,7 +1,7 @@ const should = require('should'); const sinon = require('sinon'); -const urlUtils = require('../../../../core/shared/url-utils'); -const UrlGenerator = require('../../../../core/frontend/services/url/UrlGenerator'); +const urlUtils = require('../../../../../core/shared/url-utils'); +const UrlGenerator = require('../../../../../core/frontend/services/url/UrlGenerator'); describe('Unit: services/url/UrlGenerator', function () { let queue; diff --git a/test/unit/services/url/UrlService.test.js b/test/unit/frontend/services/url/UrlService.test.js similarity index 96% rename from test/unit/services/url/UrlService.test.js rename to test/unit/frontend/services/url/UrlService.test.js index 69607e7379..0f71ef458f 100644 --- a/test/unit/services/url/UrlService.test.js +++ b/test/unit/frontend/services/url/UrlService.test.js @@ -4,12 +4,12 @@ const Promise = require('bluebird'); const rewire = require('rewire'); const should = require('should'); const sinon = require('sinon'); -const events = require('../../../../core/server/lib/common/events'); -const Queue = require('../../../../core/frontend/services/url/Queue'); -const Resources = require('../../../../core/frontend/services/url/Resources'); -const UrlGenerator = require('../../../../core/frontend/services/url/UrlGenerator'); -const Urls = require('../../../../core/frontend/services/url/Urls'); -const UrlService = rewire('../../../../core/frontend/services/url/UrlService'); +const events = require('../../../../../core/server/lib/common/events'); +const Queue = require('../../../../../core/frontend/services/url/Queue'); +const Resources = require('../../../../../core/frontend/services/url/Resources'); +const UrlGenerator = require('../../../../../core/frontend/services/url/UrlGenerator'); +const Urls = require('../../../../../core/frontend/services/url/Urls'); +const UrlService = rewire('../../../../../core/frontend/services/url/UrlService'); describe('Unit: services/url/UrlService', function () { let QueueStub; diff --git a/test/unit/services/url/Urls.test.js b/test/unit/frontend/services/url/Urls.test.js similarity index 95% rename from test/unit/services/url/Urls.test.js rename to test/unit/frontend/services/url/Urls.test.js index e0af8860b7..46c8815120 100644 --- a/test/unit/services/url/Urls.test.js +++ b/test/unit/frontend/services/url/Urls.test.js @@ -1,7 +1,7 @@ const should = require('should'); const sinon = require('sinon'); -const events = require('../../../../core/server/lib/common/events'); -const Urls = require('../../../../core/frontend/services/url/Urls'); +const events = require('../../../../../core/server/lib/common/events'); +const Urls = require('../../../../../core/frontend/services/url/Urls'); describe('Unit: services/url/Urls', function () { let urls;