repo
stringlengths
5
106
file_url
stringlengths
78
301
file_path
stringlengths
4
211
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:56:49
2026-01-05 02:23:25
truncated
bool
2 classes
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/services/routing/controllers/collection.test.js
ghost/core/test/unit/frontend/services/routing/controllers/collection.test.js
const errors = require('@tryghost/errors'); const should = require('should'); const sinon = require('sinon'); const testUtils = require('../../../../../utils'); const security = require('@tryghost/security'); const themeEngine = require('../../../../../../core/frontend/services/theme-engine'); const routerManager = req...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/services/routing/controllers/channel.test.js
ghost/core/test/unit/frontend/services/routing/controllers/channel.test.js
const errors = require('@tryghost/errors'); const should = require('should'); const sinon = require('sinon'); const testUtils = require('../../../../../utils'); const security = require('@tryghost/security'); const themeEngine = require('../../../../../../core/frontend/services/theme-engine'); const controllers = requi...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/services/routing/controllers/previews.test.js
ghost/core/test/unit/frontend/services/routing/controllers/previews.test.js
const should = require('should'); const sinon = require('sinon'); const testUtils = require('../../../../../utils'); const configUtils = require('../../../../../utils/configUtils'); const api = require('../../../../../../core/frontend/services/proxy').api; const controllers = require('../../../../../../core/frontend/se...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/services/routing/controllers/static.test.js
ghost/core/test/unit/frontend/services/routing/controllers/static.test.js
const should = require('should'); const sinon = require('sinon'); const api = require('../../../../../../core/frontend/services/proxy').api; const themeEngine = require('../../../../../../core/frontend/services/theme-engine'); const renderer = require('../../../../../../core/frontend/services/rendering'); const contro...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/services/routing/controllers/entry.test.js
ghost/core/test/unit/frontend/services/routing/controllers/entry.test.js
const should = require('should'); const sinon = require('sinon'); const testUtils = require('../../../../../utils'); const configUtils = require('../../../../../utils/configUtils'); const urlUtils = require('../../../../../../core/shared/url-utils'); const routerManager = require('../../../../../../core/frontend/servic...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/services/routing/controllers/rss.test.js
ghost/core/test/unit/frontend/services/routing/controllers/rss.test.js
const sinon = require('sinon'); 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 dataService...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/services/routing/middlewares/page-param.test.js
ghost/core/test/unit/frontend/services/routing/middlewares/page-param.test.js
const should = require('should'); const sinon = require('sinon'); const errors = require('@tryghost/errors'); const urlUtils = require('../../../../../../core/shared/url-utils'); const middleware = require('../../../../../../core/frontend/services/routing/middleware'); describe('UNIT: services/routing/middleware/page-...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/services/assets-minification/minifier.test.js
ghost/core/test/unit/frontend/services/assets-minification/minifier.test.js
const should = require('should'); const path = require('path'); const fs = require('fs').promises; const os = require('os'); const Minifier = require('../../../../../core/frontend/services/assets-minification/Minifier'); describe('Minifier', function () { let minifier; let testDir; before(async function ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/services/assets-minification/fixtures/basic-cards/js/empty.js
ghost/core/test/unit/frontend/services/assets-minification/fixtures/basic-cards/js/empty.js
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/services/assets-minification/fixtures/basic-cards/js/gallery.js
ghost/core/test/unit/frontend/services/assets-minification/fixtures/basic-cards/js/gallery.js
// eslint-disable-next-line no-undef var images = document.querySelectorAll('.kg-gallery-image img'); images.forEach(function (image) { var container = image.closest('.kg-gallery-image'); var width = image.attributes.width.value; var height = image.attributes.height.value; var ratio = width / height; ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/services/rss/generate-feed.test.js
ghost/core/test/unit/frontend/services/rss/generate-feed.test.js
const should = require('should'); const sinon = require('sinon'); const _ = require('lodash'); const testUtils = require('../../../../utils'); const configUtils = require('../../../../utils/configUtils'); const routerManager = require('../../../../../core/frontend/services/routing').routerManager; const generateFeed = ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/services/rss/cache.test.js
ghost/core/test/unit/frontend/services/rss/cache.test.js
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'); describe('RSS: Cache', function () { let generateSpy; let generateFeedRes...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/services/rss/renderer.test.js
ghost/core/test/unit/frontend/services/rss/renderer.test.js
const should = require('should'); const sinon = require('sinon'); const rssCache = require('../../../../../core/frontend/services/rss/cache'); const renderer = require('../../../../../core/frontend/services/rss/renderer'); describe('RSS: Renderer', function () { let rssCacheStub; let res; let baseUrl; ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/services/sitemap/generator.test.js
ghost/core/test/unit/frontend/services/sitemap/generator.test.js
const should = require('should'); const sinon = require('sinon'); const ObjectId = require('bson-objectid').default; const _ = require('lodash'); const moment = require('moment'); const assert = require('assert/strict'); const testUtils = require('../../../../utils'); const urlUtils = require('../../../../../core/share...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/services/sitemap/manager.test.js
ghost/core/test/unit/frontend/services/sitemap/manager.test.js
const should = require('should'); const sinon = require('sinon'); const assert = require('assert/strict'); // Stuff we are testing const DomainEvents = require('@tryghost/domain-events'); const {URLResourceUpdatedEvent} = require('../../../../../core/shared/events'); const events = require('../../../../../core/server...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/services/theme-engine/config.test.js
ghost/core/test/unit/frontend/services/theme-engine/config.test.js
const should = require('should'); const sinon = require('sinon'); const themeConfig = require('../../../../../core/frontend/services/theme-engine/config'); describe('Themes', function () { afterEach(function () { sinon.restore(); }); describe('Config', function () { it('handles no package....
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/services/theme-engine/i18next.test.js
ghost/core/test/unit/frontend/services/theme-engine/i18next.test.js
const should = require('should'); const sinon = require('sinon'); const ThemeI18n = require('../../../../../core/frontend/services/theme-engine/i18next/ThemeI18n'); const path = require('path'); describe('NEW i18nextThemeI18n Class behavior', function () { let i18n; const testBasePath = path.join(__dirname, '....
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/services/theme-engine/active.test.js
ghost/core/test/unit/frontend/services/theme-engine/active.test.js
const should = require('should'); const sinon = require('sinon'); 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/se...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/services/theme-engine/i18n.test.js
ghost/core/test/unit/frontend/services/theme-engine/i18n.test.js
const should = require('should'); const sinon = require('sinon'); const I18n = require('../../../../../core/frontend/services/theme-engine/i18n/I18n'); const logging = require('@tryghost/logging'); describe('I18n Class behavior', function () { it('defaults to en', function () { const i18n = new I18n(); ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/services/theme-engine/theme-i18n.test.js
ghost/core/test/unit/frontend/services/theme-engine/theme-i18n.test.js
const should = require('should'); const ThemeI18n = require('../../../../../core/frontend/services/theme-engine/i18n').ThemeI18n; describe('ThemeI18n Class behavior', function () { it('defaults to en', function () { const i18n = new ThemeI18n(); i18n.locale().should.eql('en'); }); });
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/services/theme-engine/preview.test.js
ghost/core/test/unit/frontend/services/theme-engine/preview.test.js
const should = require('should'); const preview = require('../../../../../core/frontend/services/theme-engine/preview'); describe('Theme Preview', function () { let req, previewString = ''; before(function () { req = { header: () => { return previewString; } ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/services/theme-engine/middleware.test.js
ghost/core/test/unit/frontend/services/theme-engine/middleware.test.js
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; // is only exposed via themeEngine.getActive() const activeTheme = require('../...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/services/theme-engine/handlebars/template.test.js
ghost/core/test/unit/frontend/services/theme-engine/handlebars/template.test.js
const should = require('should'); const errors = require('@tryghost/errors'); const {hbs, templates} = require('../../../../../../core/frontend/services/handlebars'); describe('Helpers Template', function () { it('can execute a template', function () { hbs.registerPartial('test', '<h1>Hello {{name}}</h1>')...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/services/theme-engine/handlebars/helpers.test.js
ghost/core/test/unit/frontend/services/theme-engine/handlebars/helpers.test.js
const should = require('should'); const _ = require('lodash'); const hbs = require('../../../../../../core/frontend/services/theme-engine/engine'); // Stuff we are testing const helpers = require('../../../../../../core/frontend/services/helpers'); describe('Helpers', function () { const hbsHelpers = ['each', 'if...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/services/data/fetch-data.test.js
ghost/core/test/unit/frontend/services/data/fetch-data.test.js
const should = require('should'); const sinon = require('sinon'); const api = require('../../../../../core/frontend/services/proxy').api; const data = require('../../../../../core/frontend/services/data'); const testUtils = require('../../../../utils'); describe('Unit - frontend/data/fetch-data', function () { le...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/services/data/entry-lookup.test.js
ghost/core/test/unit/frontend/services/data/entry-lookup.test.js
const should = require('should'); const sinon = require('sinon'); const api = require('../../../../../core/frontend/services/proxy').api; const data = require('../../../../../core/frontend/services/data'); const testUtils = require('../../../../utils'); describe('Unit - frontend/data/entry-lookup', function () { ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/services/data/checks.test.js
ghost/core/test/unit/frontend/services/data/checks.test.js
const should = require('should'); const {checks} = require('../../../../../core/frontend/services/data'); describe('Checks', function () { it('methods', function () { Object.keys(checks).should.eql([ 'isPost', 'isNewsletter', 'isPage', 'isTag', 'i...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/apps/private-blogging/input_password.test.js
ghost/core/test/unit/frontend/apps/private-blogging/input_password.test.js
// We use the name input_password to match the helper for consistency: const should = require('should'); // Stuff we are testing const input_password = require('../../../../../core/frontend/apps/private-blogging/lib/helpers/input_password'); describe('{{input_password}} helper', function () { it('has input_passwo...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/apps/private-blogging/controller.test.js
ghost/core/test/unit/frontend/apps/private-blogging/controller.test.js
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-bl...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/apps/private-blogging/middleware.test.js
ghost/core/test/unit/frontend/apps/private-blogging/middleware.test.js
const errors = require('@tryghost/errors'); 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/p...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/date.test.js
ghost/core/test/unit/frontend/helpers/date.test.js
const assert = require('assert/strict'); const sinon = require('sinon'); const should = require('should'); // Stuff we are testing const date = require('../../../../core/frontend/helpers/date'); const moment = require('moment-timezone'); describe('{{date}} helper', function () { afterEach(function () { s...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/link.test.js
ghost/core/test/unit/frontend/helpers/link.test.js
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').handleb...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/body_class.test.js
ghost/core/test/unit/frontend/helpers/body_class.test.js
const should = require('should'); const themeList = require('../../../../core/server/services/themes/list'); const sinon = require('sinon'); // Stuff we are testing const body_class = require('../../../../core/frontend/helpers/body_class'); // Stubs const proxy = require('../../../../core/frontend/services/proxy'); c...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/meta_title.test.js
ghost/core/test/unit/frontend/helpers/meta_title.test.js
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'); describe('{{meta_title}} helper', function ()...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/pagination.test.js
ghost/core/test/unit/frontend/helpers/pagination.test.js
const should = require('should'); 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/f...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/total_paid_members.test.js
ghost/core/test/unit/frontend/helpers/total_paid_members.test.js
const should = require('should'); const total_paid_members = require('../../../../core/frontend/helpers/total_paid_members'); describe('{{total_paid_members}} helper', function () { it('can render total paid members', async function () { const rendered = await total_paid_members.call({paid: 3000}); ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/foreach.test.js
ghost/core/test/unit/frontend/helpers/foreach.test.js
const should = require('should'); const sinon = require('sinon'); const _ = require('lodash'); const foreach = require('../../../../core/frontend/helpers/foreach'); const {registerHelper, shouldCompileToExpected} = require('./utils/handlebars'); describe('{{#foreach}} helper', function () { let options; let co...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/cancel_link.test.js
ghost/core/test/unit/frontend/helpers/cancel_link.test.js
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...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/content_api_url.test.js
ghost/core/test/unit/frontend/helpers/content_api_url.test.js
/* eslint-disable no-regex-spaces */ const should = require('should'); const sinon = require('sinon'); const configUtils = require('../../../utils/configUtils'); // Stuff we are testing const content_api_url = require('../../../../core/frontend/helpers/content_api_url'); const logging = require('@tryghost/logging'); ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/plural.test.js
ghost/core/test/unit/frontend/helpers/plural.test.js
const should = require('should'); // Stuff we are testing const plural = require('../../../../core/frontend/helpers/plural'); describe('{{plural}} helper', function () { it('will show no-value string', function () { const expected = 'No Posts'; const rendered = plural.call({}, 0, { ha...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/total_members.test.js
ghost/core/test/unit/frontend/helpers/total_members.test.js
const should = require('should'); const total_members = require('../../../../core/frontend/helpers/total_members'); describe('{{total_members}} helper', function () { it('can render total members', async function () { const rendered = await total_members.call({total: 50000}); should.equal(rendered...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/split.test.js
ghost/core/test/unit/frontend/helpers/split.test.js
const {registerHelper, shouldCompileToExpected} = require('./utils/handlebars'); const {SafeString} = require('handlebars'); describe('{{split}} helper in block mode', function () { before(function () { registerHelper('split'); registerHelper('foreach'); registerHelper('match'); }); ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/content_api_key.test.js
ghost/core/test/unit/frontend/helpers/content_api_key.test.js
/* eslint-disable no-regex-spaces */ const proxy = require('../../../../core/frontend/services/proxy'); const {getFrontendKey} = proxy; const should = require('should'); // Stuff we are testing const content_api_key = require('../../../../core/frontend/helpers/content_api_key'); describe('{{content_api_key}} helper',...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/social_url.test.js
ghost/core/test/unit/frontend/helpers/social_url.test.js
const should = require('should'); const handlebars = require('../../../../core/frontend/services/theme-engine/engine').handlebars; const helpers = require('../../../../core/frontend/services/helpers'); const social_url = require('../../../../core/frontend/helpers/social_url'); const socialData = { facebook: 'testu...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/get.test.js
ghost/core/test/unit/frontend/helpers/get.test.js
const assert = require('assert').strict; const should = require('should'); const sinon = require('sinon'); const {SafeString} = require('../../../../core/frontend/services/handlebars'); const configUtils = require('../../../utils/configUtils'); const loggingLib = require('@tryghost/logging'); // Stuff we are testing c...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/img_url.test.js
ghost/core/test/unit/frontend/helpers/img_url.test.js
const should = require('should'); const sinon = require('sinon'); const configUtils = require('../../../utils/configUtils'); // Stuff we are testing const img_url = require('../../../../core/frontend/helpers/img_url'); const logging = require('@tryghost/logging'); describe('{{img_url}} helper', function () { let...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/t.test.js
ghost/core/test/unit/frontend/helpers/t.test.js
const should = require('should'); const path = require('path'); 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 () { ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/reading_time.test.js
ghost/core/test/unit/frontend/helpers/reading_time.test.js
const should = require('should'); // Stuff we are testing const reading_time = require('../../../../core/frontend/helpers/reading_time'); const almostOneMinute = '<p>Ghost has a number of different user roles for your team</p>' + '<h3 id="authors">Authors</h3><p>The base user level in Ghost is an author. Auth...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/navigation.test.js
ghost/core/test/unit/frontend/helpers/navigation.test.js
const should = require('should'); 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/fronten...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/concat.test.js
ghost/core/test/unit/frontend/helpers/concat.test.js
const should = require('should'); const handlebars = require('../../../../core/frontend/services/theme-engine/engine').handlebars; const concat = require('../../../../core/frontend/helpers/concat'); const split = require('../../../../core/frontend/helpers/split'); const url = require('../../../../core/frontend/helpers...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/t-new.test.js
ghost/core/test/unit/frontend/helpers/t-new.test.js
const should = require('should'); const path = require('path'); const sinon = require('sinon'); const t = require('../../../../core/frontend/helpers/t'); const themeI18next = require('../../../../core/frontend/services/theme-engine/i18next'); const labs = require('../../../../core/shared/labs'); describe('NEW{{t}} hel...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/twitter_url.test.js
ghost/core/test/unit/frontend/helpers/twitter_url.test.js
const should = require('should'); // Stuff we are testing const twitter_url = require('../../../../core/frontend/helpers/twitter_url'); describe('{{twitter_url}} helper', function () { const options = {data: {site: {}}}; beforeEach(function () { options.data.site = {twitter: ''}; }); it('sho...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/tiers.test.js
ghost/core/test/unit/frontend/helpers/tiers.test.js
const should = require('should'); const tiersHelper = require('../../../../core/frontend/helpers/tiers'); describe('{{tiers}} helper', function () { it('can return string with tiers', function () { const tiers = [ {name: 'tier 1'}, {name: 'tier 2'}, {name: 'tier 3'} ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/next_post.test.js
ghost/core/test/unit/frontend/helpers/next_post.test.js
const errors = require('@tryghost/errors'); const sinon = require('sinon'); const markdownToMobiledoc = require('../../../utils/fixtures/data-generator').markdownToMobiledoc; const next_post = require('../../../../core/frontend/helpers/prev_post'); const api = require('../../../../core/frontend/services/proxy').api; co...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/recommendations.test.js
ghost/core/test/unit/frontend/helpers/recommendations.test.js
const should = require('should'); const sinon = require('sinon'); const models = require('../../../../core/server/models'); const api = require('../../../../core/server/api').endpoints; const hbs = require('../../../../core/frontend/services/theme-engine/engine'); const configUtils = require('../../../utils/configUtils...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/readable_url.test.js
ghost/core/test/unit/frontend/helpers/readable_url.test.js
const assert = require('node:assert/strict'); const readable_url = require('../../../../core/frontend/helpers/readable_url'); const logging = require('@tryghost/logging'); const sinon = require('sinon'); const errors = require('@tryghost/errors'); describe('{{#readable_url}} helper', function () { let loggingError...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/encode.test.js
ghost/core/test/unit/frontend/helpers/encode.test.js
const should = require('should'); // Stuff we are testing const encode = require('../../../../core/frontend/helpers/encode'); describe('{{encode}} helper', function () { it('can escape URI', function () { const uri = '$pecial!Charact3r(De[iver]y)Foo #Bar'; const expected = '%24pecial!Charact3r(De%...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/asset.test.js
ghost/core/test/unit/frontend/helpers/asset.test.js
// NOTE: the sole purpose of this suite is to test is it calls through to getAssetUrlHelper // more complicated use cases are tested directly in asset_url.spec const should = require('should'); const sinon = require('sinon'); const configUtils = require('../../../utils/configUtils'); const asset = require('../....
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/post_class.test.js
ghost/core/test/unit/frontend/helpers/post_class.test.js
const should = require('should'); // Stuff we are testing const post_class = require('../../../../core/frontend/helpers/post_class'); describe('{{post_class}} helper', function () { it('can render class string', function () { const rendered = post_class.call({}); should.exist(rendered); r...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/page_url.test.js
ghost/core/test/unit/frontend/helpers/page_url.test.js
const should = require('should'); // Stuff we are testing const page_url = require('../../../../core/frontend/helpers/page_url'); describe('{{page_url}} helper', function () { const options = {data: {root: {pagination: {}}}}; beforeEach(function () { options.data.root = {pagination: {}}; }); ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/excerpt.test.js
ghost/core/test/unit/frontend/helpers/excerpt.test.js
const should = require('should'); // Stuff we are testing const excerptHelper = require('../../../../core/frontend/helpers/excerpt'); describe('{{excerpt}} Helper', function () { function shouldRenderToExpected(data, hash, expected) { const rendered = excerptHelper.call(data, hash); should.exist(r...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/is.test.js
ghost/core/test/unit/frontend/helpers/is.test.js
const assert = require('node:assert/strict'); const sinon = require('sinon'); const is = require('../../../../core/frontend/helpers/is'); const logging = require('@tryghost/logging'); describe('{{#is}} helper', function () { afterEach(function () { sinon.restore(); }); // All positive tests it...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/comments.test.js
ghost/core/test/unit/frontend/helpers/comments.test.js
const should = require('should'); const sinon = require('sinon'); const configUtils = require('../../../utils/configUtils'); const {mockManager} = require('../../../utils/e2e-framework'); const comments = require('../../../../core/frontend/helpers/comments'); const proxy = require('../../../../core/frontend/services/p...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/link_class.test.js
ghost/core/test/unit/frontend/helpers/link_class.test.js
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 configUtils = require('../../../utils/...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/ghost_head.test.js
ghost/core/test/unit/frontend/helpers/ghost_head.test.js
/* eslint-disable no-regex-spaces */ 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 models = require('../../../../core/server/m...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
true
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/title.test.js
ghost/core/test/unit/frontend/helpers/title.test.js
const should = require('should'); // Stuff we are testing const title = require('../../../../core/frontend/helpers/title'); describe('{{title}} Helper', function () { it('can render title', function () { const rendered = title.call({title: 'Hello World'}); should.exist(rendered); rendered...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/price.test.js
ghost/core/test/unit/frontend/helpers/price.test.js
const assert = require('node:assert/strict'); const sinon = require('sinon'); const price = require('../../../../core/frontend/helpers/price'); const {registerHelper, shouldCompileToExpected} = require('./utils/handlebars'); const logging = require('@tryghost/logging'); describe('{{price}} helper', function () { ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/ghost_foot.test.js
ghost/core/test/unit/frontend/helpers/ghost_foot.test.js
const should = require('should'); const sinon = require('sinon'); const ghost_foot = require('../../../../core/frontend/helpers/ghost_foot'); const {settingsCache} = require('../../../../core/frontend/services/proxy'); describe('{{ghost_foot}} helper', function () { let settingsCacheStub; afterEach(function (...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/search.test.js
ghost/core/test/unit/frontend/helpers/search.test.js
const should = require('should'); const sinon = require('sinon'); const {registerHelper, shouldCompileToExpected} = require('./utils/handlebars'); describe('Search helper', function () { before(function () { registerHelper('search'); }); afterEach(function () { sinon.restore(); }); ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/meta_description.test.js
ghost/core/test/unit/frontend/helpers/meta_description.test.js
const should = require('should'); const sinon = require('sinon'); const meta_description = require('../../../../core/frontend/helpers/meta_description'); const settingsCache = require('../../../../core/shared/settings-cache'); describe('{{meta_description}} helper', function () { const localSettingsCache = {}; ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/facebook_url.test.js
ghost/core/test/unit/frontend/helpers/facebook_url.test.js
const should = require('should'); // Stuff we are testing const facebook_url = require('../../../../core/frontend/helpers/facebook_url'); describe('{{facebook_url}} helper', function () { const options = {data: {site: {}}}; beforeEach(function () { options.data.site = {facebook: ''}; }); it(...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/authors.test.js
ghost/core/test/unit/frontend/helpers/authors.test.js
const should = require('should'); const sinon = require('sinon'); const urlService = require('../../../../core/server/services/url'); const authorsHelper = require('../../../../core/frontend/helpers/authors'); const models = require('../../../../core/server/models'); const testUtils = require('../../../utils'); descri...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/tags.test.js
ghost/core/test/unit/frontend/helpers/tags.test.js
const should = require('should'); const sinon = require('sinon'); const testUtils = require('../../../utils'); const urlService = require('../../../../core/server/services/url'); const models = require('../../../../core/server/models'); const tagsHelper = require('../../../../core/frontend/helpers/tags'); describe('{{...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/raw.test.js
ghost/core/test/unit/frontend/helpers/raw.test.js
const should = require('should'); const raw = require('../../../../core/frontend/helpers/raw'); const handlebars = require('../../../../core/frontend/services/theme-engine/engine').handlebars; let defaultGlobals; function compile(templateString) { const template = handlebars.compile(templateString); template....
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/match.test.js
ghost/core/test/unit/frontend/helpers/match.test.js
const should = require('should'); const sinon = require('sinon'); const _ = require('lodash'); const {registerHelper, shouldCompileToExpected} = require('./utils/handlebars'); const {SafeString} = require('express-hbs'); describe('Match helper', function () { before(function () { registerHelper('match'); ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/content.test.js
ghost/core/test/unit/frontend/helpers/content.test.js
const should = require('should'); 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 has = require('.....
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/comment_count.test.js
ghost/core/test/unit/frontend/helpers/comment_count.test.js
const should = require('should'); const sinon = require('sinon'); const configUtils = require('../../../utils/configUtils'); const {mockManager} = require('../../../utils/e2e-framework'); const proxy = require('../../../../core/frontend/services/proxy'); const {html} = require('common-tags'); const {settingsCache} = p...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/url.test.js
ghost/core/test/unit/frontend/helpers/url.test.js
const should = require('should'); const sinon = require('sinon'); const testUtils = require('../../../utils'); const configUtils = require('../../../utils/configUtils'); const markdownToMobiledoc = require('../../../utils/fixtures/data-generator').markdownToMobiledoc; const url = require('../../../../core/frontend/hel...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/prev_post.test.js
ghost/core/test/unit/frontend/helpers/prev_post.test.js
const errors = require('@tryghost/errors'); const sinon = require('sinon'); const markdownToMobiledoc = require('../../../utils/fixtures/data-generator').markdownToMobiledoc; const prev_post = require('../../../../core/frontend/helpers/prev_post'); const api = require('../../../../core/frontend/services/proxy').api; co...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/has.test.js
ghost/core/test/unit/frontend/helpers/has.test.js
const should = require('should'); const sinon = require('sinon'); // Stuff we are testing const has = require('../../../../core/frontend/helpers/has'); describe('{{#has}} helper', function () { let fn; let inverse; let thisCtx; let handlebarsOptions; afterEach(function () { sinon.restore(...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/helpers/utils/handlebars.js
ghost/core/test/unit/frontend/helpers/utils/handlebars.js
const assert = require('assert/strict'); const handlebars = require('../../../../../core/frontend/services/theme-engine/engine').handlebars; module.exports.shouldCompileToExpected = (templateString, hash, expected) => { const template = handlebars.compile(templateString); const result = template(hash); as...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/src/url-attribution.test.js
ghost/core/test/unit/frontend/src/url-attribution.test.js
const should = require('should'); const sinon = require('sinon'); const {JSDOM} = require('jsdom'); // Use path relative to test file const { parseReferrerData, getReferrer } = require('../../../../core/frontend/src/utils/url-attribution'); describe('URL Attribution Utils', function () { let dom; let ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/src/privacy.test.js
ghost/core/test/unit/frontend/src/privacy.test.js
const should = require('should'); // Use path relative to test file const { processPayload, maskSensitiveData } = require('../../../../core/frontend/src/utils/privacy'); describe('Privacy Utils', function () { describe('maskSensitiveData', function () { it('should mask default sensitive attributes...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/public/ghost-stats.test.js
ghost/core/test/unit/frontend/public/ghost-stats.test.js
const {expect} = require('chai'); const sinon = require('sinon'); const path = require('path'); describe('ghost-stats.js', function () { let sandbox; let mockWindow; let mockDocument; let mockFetch; let mockStorage; let browserService; let ghostStats; // Test helper functions const...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/utils/member-count.test.js
ghost/core/test/unit/frontend/utils/member-count.test.js
const should = require('should'); const {memberCountRounding, getMemberStats} = require('../../../../core/frontend/utils/member-count'); const getMemberStatsMock = [ { members: 30, expected: '30' }, { members: 55, expected: '50+' }, { members: 580, ex...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/utils/frontend-apps.test.js
ghost/core/test/unit/frontend/utils/frontend-apps.test.js
const should = require('should'); const {getFrontendAppConfig, getDataAttributes} = require('../../../../core/frontend/utils/frontend-apps'); const configUtils = require('../../../utils/configUtils'); describe('Frontend apps:', function () { describe('getFrontendAppConfig', function () { before(function ()...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/web/middleware/redirect-ghost-to-admin.test.js
ghost/core/test/unit/frontend/web/middleware/redirect-ghost-to-admin.test.js
const should = require('should'); const sinon = require('sinon'); const redirectGhostToAdmin = require('../../../../../core/frontend/web/middleware/redirect-ghost-to-admin'); const {handleAdminRedirect} = require('../../../../../core/frontend/web/middleware/redirect-ghost-to-admin'); const configUtils = require('../../...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/web/middleware/handle-image-sizes.test.js
ghost/core/test/unit/frontend/web/middleware/handle-image-sizes.test.js
const should = require('should'); const sinon = require('sinon'); const storage = require('../../../../../core/server/adapters/storage'); const activeTheme = require('../../../../../core/frontend/services/theme-engine/active'); const handleImageSizes = require('../../../../../core/frontend/web/middleware/handle-image-s...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/web/middleware/error-handler.test.js
ghost/core/test/unit/frontend/web/middleware/error-handler.test.js
const should = require('should'); const sinon = require('sinon'); const errors = require('@tryghost/errors'); const {handleThemeResponse} = require('../../../../../core/frontend/web/middleware/error-handler'); describe('Frontend Error Handler', function () { let req; let res; let next; beforeEach(fun...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/web/middleware/static-theme.test.js
ghost/core/test/unit/frontend/web/middleware/static-theme.test.js
const should = require('should'); const sinon = require('sinon'); const express = require('../../../../../core/shared/express'); const themeEngine = require('../../../../../core/frontend/services/theme-engine'); const staticTheme = require('../../../../../core/frontend/web/middleware/static-theme'); describe('staticT...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/web/middleware/frontend-caching.test.js
ghost/core/test/unit/frontend/web/middleware/frontend-caching.test.js
const assert = require('node:assert').strict; const sinon = require('sinon'); const testUtils = require('../../../../utils'); const configUtils = require('../../../../utils/configUtils'); const frontendCaching = require('../../../../../core/frontend/web/middleware/frontend-caching'); const cacheMembersContentConfigKe...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/web/middleware/serve-public-file.test.js
ghost/core/test/unit/frontend/web/middleware/serve-public-file.test.js
const should = require('should'); const sinon = require('sinon'); const fs = require('fs-extra'); const servePublicFile = require('../../../../../core/frontend/web/middleware/serve-public-file'); describe('servePublicFile', function () { let res; let req; let next; beforeEach(function () { res...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/web/routers/serve-favicon.test.js
ghost/core/test/unit/frontend/web/routers/serve-favicon.test.js
const sinon = require('sinon'); const request = require('supertest'); const express = require('../../../../../core/shared/express'); const serveFavicon = require('../../../../../core/frontend/web/routers/serve-favicon'); const settingsCache = require('../../../../../core/shared/settings-cache'); const storage = require...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/meta/og-image.test.js
ghost/core/test/unit/frontend/meta/og-image.test.js
const should = require('should'); const sinon = require('sinon'); const getOgImage = require('../../../../core/frontend/meta/og-image'); const settingsCache = require('../../../../core/shared/settings-cache'); describe('getOgImage', function () { let localSettingsCache = {}; beforeEach(function () { s...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/meta/author-url.test.js
ghost/core/test/unit/frontend/meta/author-url.test.js
const should = require('should'); const sinon = require('sinon'); const ObjectId = require('bson-objectid').default; const urlService = require('../../../../core/server/services/url'); const getAuthorUrl = require('../../../../core/frontend/meta/author-url'); describe('getAuthorUrl', function () { /** @type {impor...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/meta/paginated-url.test.js
ghost/core/test/unit/frontend/meta/paginated-url.test.js
const should = require('should'); const getPaginatedUrl = require('../../../../core/frontend/meta/paginated-url'); const configUtils = require('../../../utils/configUtils'); describe('getPaginatedUrl', function () { let data; beforeEach(function () { data = {}; }); const getTestUrls = functio...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/meta/modified-date.test.js
ghost/core/test/unit/frontend/meta/modified-date.test.js
const should = require('should'); 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 () { const modDate = getModifiedDate({ context: ['post'], ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/meta/author-image.test.js
ghost/core/test/unit/frontend/meta/author-image.test.js
const should = require('should'); const sinon = require('sinon'); const getAuthorImage = require('../../../../core/frontend/meta/author-image'); describe('getAuthorImage', function () { afterEach(function () { sinon.restore(); }); it('should return author image url if post and has url', function (...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/meta/image-dimensions.test.js
ghost/core/test/unit/frontend/meta/image-dimensions.test.js
const _ = require('lodash'); const should = require('should'); const sinon = require('sinon'); const rewire = require('rewire'); const getImageDimensions = rewire('../../../../core/frontend/meta/image-dimensions'); describe('getImageDimensions', function () { let sizeOfStub; beforeEach(function () { s...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/meta/rss-url.test.js
ghost/core/test/unit/frontend/meta/rss-url.test.js
const should = require('should'); const sinon = require('sinon'); const routing = require('../../../../core/frontend/services/routing'); const getRssUrl = require('../../../../core/frontend/meta/rss-url'); describe('getRssUrl', function () { beforeEach(function () { sinon.stub(routing.registry, 'getRssUrl'...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false