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/meta/author-fb-url.test.js
ghost/core/test/unit/frontend/meta/author-fb-url.test.js
const should = require('should'); const getAuthorFacebookUrl = require('../../../../core/frontend/meta/author-fb-url'); describe('getAuthorFacebookUrl', function () { it('should return author facebook url if post and has url', function () { const facebookUrl = getAuthorFacebookUrl({ ...
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/description.test.js
ghost/core/test/unit/frontend/meta/description.test.js
const should = require('should'); const sinon = require('sinon'); const getMetaDescription = require('../../../../core/frontend/meta/description'); const settingsCache = require('../../../../core/shared/settings-cache'); describe('getMetaDescription', function () { let localSettingsCache = {}; 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/meta/context-object.test.js
ghost/core/test/unit/frontend/meta/context-object.test.js
const should = require('should'); const sinon = require('sinon'); const getContextObject = require('../../../../core/frontend/meta/context-object.js'); const settingsCache = require('../../../../core/shared/settings-cache'); describe('getContextObject', function () { let data; let context; let contextObjec...
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/structured-data.test.js
ghost/core/test/unit/frontend/meta/structured-data.test.js
const should = require('should'); const getStructuredData = require('../../../../core/frontend/meta/structured-data'); describe('getStructuredData', function () { it('should return structured data from metadata per post', function (done) { const metadata = { site: { title: 'Site...
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/cover-image.test.js
ghost/core/test/unit/frontend/meta/cover-image.test.js
const should = require('should'); const getCoverImage = require('../../../../core/frontend/meta/cover-image'); describe('getCoverImage', function () { it('should return absolute cover image url for home', function () { const coverImageUrl = getCoverImage({ context: ['home'], home: {...
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/twitter-image.test.js
ghost/core/test/unit/frontend/meta/twitter-image.test.js
const should = require('should'); const sinon = require('sinon'); const getTwitterImage = require('../../../../core/frontend/meta/twitter-image'); const settingsCache = require('../../../../core/shared/settings-cache'); describe('getTwitterImage', function () { let localSettingsCache = {}; beforeEach(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/blog-logo.test.js
ghost/core/test/unit/frontend/meta/blog-logo.test.js
const should = require('should'); const getBlogLogo = require('../../../../core/frontend/meta/blog-logo'); const sinon = require('sinon'); const settingsCache = require('../../../../core/shared/settings-cache'); describe('getBlogLogo', function () { afterEach(function () { sinon.restore(); }); 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/meta/canonical-url.test.js
ghost/core/test/unit/frontend/meta/canonical-url.test.js
const sinon = require('sinon'); const rewire = require('rewire'); const urlUtils = require('../../../../core/shared/url-utils'); const testUtils = require('../../../utils'); let getCanonicalUrl = rewire('../../../../core/frontend/meta/canonical-url'); describe('getCanonicalUrl', function () { let getUrlStub; ...
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/published-date.test.js
ghost/core/test/unit/frontend/meta/published-date.test.js
const should = require('should'); 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 () { const pubDate = getPublishedDate({ context: ['po...
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-type.test.js
ghost/core/test/unit/frontend/meta/og-type.test.js
const should = require('should'); const getOgType = require('../../../../core/frontend/meta/og-type'); describe('getOgType', function () { it('should return og type profile if context is type author', function () { const ogType = getOgType({ context: ['author'] }); should.equal(...
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/title.test.js
ghost/core/test/unit/frontend/meta/title.test.js
const should = require('should'); const sinon = require('sinon'); const getTitle = require('../../../../core/frontend/meta/title'); const settingsCache = require('../../../../core/shared/settings-cache'); describe('getTitle', function () { let localSettingsCache = {}; beforeEach(function () { sinon.st...
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/keywords.test.js
ghost/core/test/unit/frontend/meta/keywords.test.js
const should = require('should'); const sinon = require('sinon'); const models = require('../../../../core/server/models'); const getKeywords = require('../../../../core/frontend/meta/keywords'); describe('getKeywords', function () { before(function () { models.init(); }); 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/meta/schema.test.js
ghost/core/test/unit/frontend/meta/schema.test.js
const should = require('should'); const {getSchema, SOCIAL_PLATFORMS} = require('../../../../core/frontend/meta/schema'); const socialUrls = require('@tryghost/social-urls'); // Re-usable social usernames for sameAs tests const USERNAMES = { facebook: 'fbuser', twitter: 'twuser', threads: 'threadsuser', ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
true
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/frontend/meta/asset-url.test.js
ghost/core/test/unit/frontend/meta/asset-url.test.js
const should = require('should'); const sinon = require('sinon'); const {SafeString} = require('../../../../core/frontend/services/handlebars'); const imageLib = require('../../../../core/server/lib/image'); const settingsCache = require('../../../../core/shared/settings-cache'); const configUtils = require('../../../u...
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/generate-excerpt.test.js
ghost/core/test/unit/frontend/meta/generate-excerpt.test.js
const assert = require('assert/strict'); const generateExcerpt = require('../../../../core/frontend/meta/generate-excerpt'); describe('generateExcerpt', function () { it('should fallback to 50 words if not specified', function () { const html = 'This is an auto-generated excerpt. It contains a plaintext ve...
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/url.test.js
ghost/core/test/unit/frontend/meta/url.test.js
const sinon = require('sinon'); const urlUtils = require('../../../../core/shared/url-utils'); const urlService = require('../../../../core/server/services/url'); const getUrl = require('../../../../core/frontend/meta/url'); const testUtils = require('../../../utils'); describe('getUrl', function () { let urlServi...
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/creator-url.test.js
ghost/core/test/unit/frontend/meta/creator-url.test.js
const should = require('should'); const getCreatorTwitterUrl = require('../../../../core/frontend/meta/creator-url'); describe('getCreatorTwitterUrl', function () { it('should return author twitter url if post and has url', function () { const twitterUrl = getCreatorTwitterUrl({ ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/overrides.test.js
ghost/core/test/unit/server/overrides.test.js
const should = require('should'); const luxon = require('luxon'); require('../../../core/server/overrides'); describe('Overrides', function () { it('sets global timezone to UTC', function () { should.equal(luxon.DateTime.local().zoneName, 'UTC'); }); });
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/notify.test.js
ghost/core/test/unit/server/notify.test.js
const should = require('should'); const sinon = require('sinon'); const configUtils = require('../../utils/configUtils'); const events = require('../../../core/server/lib/common/events'); const bootstrapSocket = require('../../../core/server/lib/bootstrap-socket'); describe('Notify', function () { describe('notif...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/verification-trigger.test.js
ghost/core/test/unit/server/services/verification-trigger.test.js
// Switch these lines once there are useful utils // const testUtils = require('./utils'); const sinon = require('sinon'); const assert = require('assert/strict'); require('should'); const VerificationTrigger = require('../../../../core/server/services/VerificationTrigger'); const DomainEvents = require('@tryghost/doma...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/slack.test.js
ghost/core/test/unit/server/services/slack.test.js
const sinon = require('sinon'); const _ = require('lodash'); const rewire = require('rewire'); const testUtils = require('../../../utils'); const configUtils = require('../../../utils/configUtils'); // Stuff we test const slack = rewire('../../../../core/server/services/slack'); const events = require('../../../../co...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/update-check.test.js
ghost/core/test/unit/server/services/update-check.test.js
require('should'); const sinon = require('sinon'); const nock = require('nock'); const moment = require('moment'); const crypto = require('crypto'); const assert = require('assert/strict'); const util = require('util'); const logging = require('@tryghost/logging'); const request = require('@tryghost/request'); const Up...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/limits.test.js
ghost/core/test/unit/server/services/limits.test.js
const assert = require('assert/strict'); const sinon = require('sinon'); const rewire = require('rewire'); const limits = rewire('../../../../core/server/services/limits'); const configUtils = require('../../../utils/configUtils'); const logging = require('@tryghost/logging'); const errors = require('@tryghost/errors...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/xmlrpc.test.js
ghost/core/test/unit/server/services/xmlrpc.test.js
const sinon = require('sinon'); const _ = require('lodash'); const nock = require('nock'); const rewire = require('rewire'); const testUtils = require('../../../utils'); const configUtils = require('../../../utils/configUtils'); const xmlrpc = rewire('../../../../core/server/services/xmlrpc'); const events = require('....
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/oembed/nft-oembed.test.js
ghost/core/test/unit/server/services/oembed/nft-oembed.test.js
const assert = require('assert/strict'); const NFTOembedProvider = require('../../../../../core/server/services/oembed/NFTOEmbedProvider'); describe('NFTOEmbedProvider', function () { it('Can support requests for OpenSea Ethereum NTFs', async function () { const provider = new NFTOembedProvider({ ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/oembed/oembed-service.test.js
ghost/core/test/unit/server/services/oembed/oembed-service.test.js
const assert = require('assert/strict'); const nock = require('nock'); const got = require('got'); const OembedService = require('../../../../../core/server/services/oembed/OEmbedService'); describe('oembed-service', function () { /** @type {OembedService} */ let oembedService; 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/server/services/oembed/twitter-embed.test.js
ghost/core/test/unit/server/services/oembed/twitter-embed.test.js
const assert = require('assert/strict'); const logging = require('@tryghost/logging'); const sinon = require('sinon'); const TwitterOEmbedProvider = require('../../../../../core/server/services/oembed/TwitterOEmbedProvider'); const externalRequest = require('../../../../../core/server/lib/request-external'); const nock...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/email-suppression-list/EmailSuppressionList.test.js
ghost/core/test/unit/server/services/email-suppression-list/EmailSuppressionList.test.js
const assert = require('assert/strict'); const {EmailSuppressionData, EmailSuppressedEvent} = require('../../../../../core/server/services/email-suppression-list/EmailSuppressionList'); describe('EmailSuppressionData', function () { it('Has null info when not suppressed', function () { const now = new Date...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/link-redirection/LinkRedirectsService.test.js
ghost/core/test/unit/server/services/link-redirection/LinkRedirectsService.test.js
const LinkRedirectsService = require('../../../../../core/server/services/link-redirection/LinkRedirectsService'); const assert = require('assert/strict'); const sinon = require('sinon'); const crypto = require('crypto'); describe('LinkRedirectsService', function () { 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/server/services/link-redirection/LinkRedirectRepository.test.js
ghost/core/test/unit/server/services/link-redirection/LinkRedirectRepository.test.js
const should = require('should'); const sinon = require('sinon'); const ObjectID = require('bson-objectid').default; const EventEmitter = require('events').EventEmitter; const LinkRedirectRepository = require('../../../../../core/server/services/link-redirection/LinkRedirectRepository'); const LinkRedirect = require('...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/newsletters/index.test.js
ghost/core/test/unit/server/services/newsletters/index.test.js
const models = require('../../../../../core/server/models'); const assert = require('assert/strict'); describe('Newsletters Service', function () { let newslettersService; before(function () { models.init(); }); describe('Newsletter Service', function () { it('Provides expected public...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/newsletters/service.test.js
ghost/core/test/unit/server/services/newsletters/service.test.js
const sinon = require('sinon'); const assert = require('assert/strict'); // DI requirements const models = require('../../../../../core/server/models'); const mail = require('../../../../../core/server/services/mail'); // Mocked utilities const urlUtils = require('../../../../utils/urlUtils'); const {mockManager} = r...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/auth/setup.test.js
ghost/core/test/unit/server/services/auth/setup.test.js
const {doProductAndNewsletter: doTierAndNewsletter} = require('../../../../../core/server/services/auth/setup'); const sinon = require('sinon'); describe('Auth Service: setup', function () { afterEach(function () { sinon.restore(); }); describe('doProductAndNewsletter', function () { it('u...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/auth/SessionFromToken.test.js
ghost/core/test/unit/server/services/auth/SessionFromToken.test.js
const express = require('express'); const sinon = require('sinon'); const should = require('should'); const SessionFromToken = require('../../../../../core/server/services/auth/session/session-from-token'); describe('SessionFromToken', function () { it('Parses the request, matches the user to the token, sets the u...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/auth/session/signin-email.test.js
ghost/core/test/unit/server/services/auth/session/signin-email.test.js
const assert = require('node:assert/strict'); const signinEmail = require('../../../../../../core/server/services/auth/session/emails/signin'); const t = s => s; const baseDetails = { siteTitle: 'Example Site', email: 'test@example.com', siteDomain: 'blog.example.com', siteUrl: 'https://blog.example.c...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/auth/session/store.test.js
ghost/core/test/unit/server/services/auth/session/store.test.js
const SessionStore = require('../../../../../../core/server/services/auth/session/SessionStore'); const models = require('../../../../../../core/server/models'); const EventEmitter = require('events'); const {Store} = require('express-session'); const sinon = require('sinon'); const should = require('should'); describ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/auth/session/session-service.test.js
ghost/core/test/unit/server/services/auth/session/session-service.test.js
const should = require('should'); const sinon = require('sinon'); const express = require('express'); const SessionService = require('../../../../../../core/server/services/auth/session/session-service'); describe('SessionService', function () { let getSettingsCache; beforeEach(function () { getSettin...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/auth/session/middleware.test.js
ghost/core/test/unit/server/services/auth/session/middleware.test.js
const sessionMiddleware = require('../../../../../../core/server/services/auth').session; const SessionMiddlware = require('../../../../../../core/server/services/auth/session/middleware'); const models = require('../../../../../../core/server/models'); const sinon = require('sinon'); const should = require('should'); ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/auth/api-key/admin.test.js
ghost/core/test/unit/server/services/auth/api-key/admin.test.js
const errors = require('@tryghost/errors'); const jwt = require('jsonwebtoken'); const should = require('should'); const sinon = require('sinon'); const apiKeyAuth = require('../../../../../../core/server/services/auth/api-key'); const models = require('../../../../../../core/server/models'); describe('Admin API Key A...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/auth/api-key/content.test.js
ghost/core/test/unit/server/services/auth/api-key/content.test.js
const errors = require('@tryghost/errors'); const {authenticateContentApiKey} = require('../../../../../../core/server/services/auth/api-key/content'); const models = require('../../../../../../core/server/models'); const should = require('should'); const sinon = require('sinon'); describe('Content API Key Auth', func...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/auth/members/index.test.js
ghost/core/test/unit/server/services/auth/members/index.test.js
const jwt = require('jsonwebtoken'); const should = require('should'); const {UnauthorizedError} = require('@tryghost/errors'); const members = require('../../../../../../core/server/services/auth/members'); describe('Auth Service - Members', function () { it('exports an authenticateMembersToken method', function ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/staff/index.test.js
ghost/core/test/unit/server/services/staff/index.test.js
const sinon = require('sinon'); const staffService = require('../../../../../core/server/services/staff'); const DomainEvents = require('@tryghost/domain-events'); const {mockManager} = require('../../../../utils/e2e-framework'); const models = require('../../../../../core/server/models'); const {SubscriptionCancelle...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/staff/staff-service.test.js
ghost/core/test/unit/server/services/staff/staff-service.test.js
// Switch these lines once there are useful utils // const testUtils = require('./utils'); const sinon = require('sinon'); const {MemberCreatedEvent, SubscriptionCancelledEvent, SubscriptionActivatedEvent} = require('../../../../../core/shared/events'); const MilestoneCreatedEvent = require('../../../../../core/server/...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
true
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/media-inliner/test/ExternalMediaInliner.test.js
ghost/core/test/unit/server/services/media-inliner/test/ExternalMediaInliner.test.js
const assert = require('assert/strict'); const fs = require('fs'); const sinon = require('sinon'); const nock = require('nock'); const path = require('path'); const loggingLib = require('@tryghost/logging'); const ExternalMediaInliner = require('../../../../../../core/server/services/media-inliner/ExternalMediaInliner'...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
true
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/link-tracking/PostLinkRepository.test.js
ghost/core/test/unit/server/services/link-tracking/PostLinkRepository.test.js
const should = require('should'); const sinon = require('sinon'); const PostLinkRepository = require('../../../../../core/server/services/link-tracking/PostLinkRepository'); describe('UNIT: PostLinkRepository class', function () { let postLinkRepository; before(function () { postLinkRepository = new ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/link-tracking/LinkClickTrackingService.test.js
ghost/core/test/unit/server/services/link-tracking/LinkClickTrackingService.test.js
const LinkClickTrackingService = require('../../../../../core/server/services/link-tracking/LinkClickTrackingService'); const sinon = require('sinon'); const should = require('should'); const assert = require('assert/strict'); const ObjectID = require('bson-objectid').default; const PostLink = require('../../../../../c...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/link-tracking/LinkClickRepository.test.js
ghost/core/test/unit/server/services/link-tracking/LinkClickRepository.test.js
const should = require('should'); const sinon = require('sinon'); const ObjectID = require('bson-objectid').default; const configUtils = require('../../../../utils/configUtils'); const LinkClickRepository = require('../../../../../core/server/services/link-tracking/LinkClickRepository'); const LinkClick = require('../...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/api-version-compatibility/legacy-api-path-match.test.js
ghost/core/test/unit/server/services/api-version-compatibility/legacy-api-path-match.test.js
const assert = require('assert/strict'); const legacyApiPathMatch = require('../../../../../core/server/services/api-version-compatibility/legacy-api-path-match'); describe('Legacy Path Match', function () { it('returns null, admin for all supported permutations', function () { const permutations = [ ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/api-version-compatibility/mw-version-rewrites.test.js
ghost/core/test/unit/server/services/api-version-compatibility/mw-version-rewrites.test.js
const sinon = require('sinon'); const assert = require('assert/strict'); const mwVersionRewrites = require('../../../../../core/server/services/api-version-compatibility/mw-version-rewrites'); const configUtils = require('../../../../utils/configUtils'); describe('MW Version Rewrites', function () { let req, res;...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/tiers/TiersAPI.test.js
ghost/core/test/unit/server/services/tiers/TiersAPI.test.js
const assert = require('assert/strict'); const TiersAPI = require('../../../../../core/server/services/tiers/TiersAPI'); const InMemoryTierRepository = require('../../../../../core/server/services/tiers/InMemoryTierRepository'); describe('TiersAPI', function () { /** @type {TiersAPI.ITierRepository} */ let re...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/tiers/TierRepository.test.js
ghost/core/test/unit/server/services/tiers/TierRepository.test.js
const assert = require('assert/strict'); const sinon = require('sinon'); const {Product: ProductModel} = require('../../../../../core/server/models/product'); const TierRepository = require('../../../../../core/server/services/tiers/TierRepository'); const Tier = require('../../../../../core/server/services/tiers/Tier'...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/tiers/Tier.test.js
ghost/core/test/unit/server/services/tiers/Tier.test.js
const assert = require('assert/strict'); const ObjectID = require('bson-objectid').default; const Tier = require('../../../../../core/server/services/tiers/Tier'); const TierActivatedEvent = require('../../../../../core/server/services/tiers/TierActivatedEvent'); const TierArchivedEvent = require('../../../../../core/s...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/outbox/index.test.js
ghost/core/test/unit/server/services/outbox/index.test.js
const sinon = require('sinon'); const rewire = require('rewire'); const DomainEvents = require('@tryghost/domain-events'); const StartOutboxProcessingEvent = require('../../../../../core/server/services/outbox/events/StartOutboxProcessingEvent'); describe('Outbox Service', function () { let service; let proces...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/mail/GhostMailer.test.js
ghost/core/test/unit/server/services/mail/GhostMailer.test.js
const dns = require('dns'); const should = require('should'); const sinon = require('sinon'); const mail = require('../../../../../core/server/services/mail'); const settingsCache = require('../../../../../core/shared/settings-cache'); const configUtils = require('../../../../utils/configUtils'); const urlUtils = requi...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/audience-feedback/AudienceFeedbackService.test.js
ghost/core/test/unit/server/services/audience-feedback/AudienceFeedbackService.test.js
const assert = require('assert/strict'); const AudienceFeedbackService = require('../../../../../core/server/services/audience-feedback/AudienceFeedbackService'); describe('audienceFeedbackService', function () { const mockData = { uuid: '7b11de3c-dff9-4563-82ae-a281122d201d', postId: '634fc3901e0a...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/frontend-data-service/index.test.js
ghost/core/test/unit/server/services/frontend-data-service/index.test.js
const models = require('../../../../../core/server/models'); const assert = require('assert/strict'); describe('Frontend Data Service', function () { let frontendDataService; before(function () { models.init(); }); it('Provides expected public API', async function () { frontendDataSer...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/frontend-data-service/frontend-data-service.test.js
ghost/core/test/unit/server/services/frontend-data-service/frontend-data-service.test.js
const assert = require('assert/strict'); const sinon = require('sinon'); const models = require('../../../../../core/server/models'); const FrontendDataService = require('../../../../../core/server/services/frontend-data-service/FrontendDataService'); const logging = require('@tryghost/logging'); describe('Frontend...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/offers/domain/models/OfferType.test.js
ghost/core/test/unit/server/services/offers/domain/models/OfferType.test.js
const should = require('should'); const OfferType = require('../../../../../../../core/server/services/offers/domain/models/OfferType'); describe('OfferType', function () { describe('OfferType.create factory', function () { it('Creates an Offer type containing either "fixed" or "percent"', function () { ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/offers/domain/models/OfferCurrency.test.js
ghost/core/test/unit/server/services/offers/domain/models/OfferCurrency.test.js
const should = require('should'); const OfferCurrency = require('../../../../../../../core/server/services/offers/domain/models/OfferCurrency'); describe('OfferCurrency', function () { describe('OfferCurrency.create factory', function () { it('Will only allow creating a currency with a 3 letter ISO string...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/offers/domain/models/OfferAmount.test.js
ghost/core/test/unit/server/services/offers/domain/models/OfferAmount.test.js
const should = require('should'); const {OfferPercentageAmount, OfferFixedAmount, OfferTrialAmount} = require('../../../../../../../core/server/services/offers/domain/models/OfferAmount'); describe('OfferAmount', function () { describe('OfferPercentageAmount', function () { describe('OfferPercentageAmount...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/offers/domain/models/Offer.test.js
ghost/core/test/unit/server/services/offers/domain/models/Offer.test.js
const should = require('should'); const ObjectID = require('bson-objectid').default; const errors = require('../../../../../../../core/server/services/offers/domain/errors'); const Offer = require('../../../../../../../core/server/services/offers/domain/models/Offer'); const OfferName = require('../../../../../../../co...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/offers/domain/models/OfferTitle.test.js
ghost/core/test/unit/server/services/offers/domain/models/OfferTitle.test.js
const should = require('should'); const OfferTitle = require('../../../../../../../core/server/services/offers/domain/models/OfferTitle'); describe('OfferTitle', function () { describe('OfferTitle.create factory', function () { it('Creates an Offer description containing a string', function () { ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/offers/domain/models/StripeCoupon.test.js
ghost/core/test/unit/server/services/offers/domain/models/StripeCoupon.test.js
const should = require('should'); const StripeCoupon = require('../../../../../../../core/server/services/offers/domain/models/StripeCoupon'); describe('StripeCoupon', function () { describe('StripeCoupon.create factory', function () { it('Creates a valid StripeCoupon with percent_off', function () { ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/offers/domain/models/OfferCadence.test.js
ghost/core/test/unit/server/services/offers/domain/models/OfferCadence.test.js
const should = require('should'); const OfferCadence = require('../../../../../../../core/server/services/offers/domain/models/OfferCadence'); describe('OfferCadence', function () { describe('OfferCadence.create factory', function () { it('Will only create an OfferCadence containing a string of either "mo...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/offers/domain/models/OfferStatus.test.js
ghost/core/test/unit/server/services/offers/domain/models/OfferStatus.test.js
const should = require('should'); const OfferStatus = require('../../../../../../../core/server/services/offers/domain/models/OfferStatus'); describe('OfferStatus', function () { describe('OfferStatus.create factory', function () { it('Creates an Offer type containing either "active" or "archived"', funct...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/offers/domain/models/OfferDescription.test.js
ghost/core/test/unit/server/services/offers/domain/models/OfferDescription.test.js
const should = require('should'); const OfferDescription = require('../../../../../../../core/server/services/offers/domain/models/OfferDescription'); describe('OfferDescription', function () { describe('OfferDescription.create factory', function () { it('Creates an Offer description containing a string',...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/offers/domain/models/OfferDuration.test.js
ghost/core/test/unit/server/services/offers/domain/models/OfferDuration.test.js
const should = require('should'); const OfferDuration = require('../../../../../../../core/server/services/offers/domain/models/OfferDuration'); describe('OfferDuration', function () { describe('OfferDuration.create factory', function () { it('Will only allow creating a once, repeating or forever duration...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/offers/domain/models/OfferCode.test.js
ghost/core/test/unit/server/services/offers/domain/models/OfferCode.test.js
const should = require('should'); const OfferCode = require('../../../../../../../core/server/services/offers/domain/models/OfferCode'); describe('OfferCode', function () { describe('OfferCode.create factory', function () { it('Creates a sluggified code of a string', function () { OfferCode.cr...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/offers/domain/models/OfferName.test.js
ghost/core/test/unit/server/services/offers/domain/models/OfferName.test.js
const should = require('should'); const OfferName = require('../../../../../../../core/server/services/offers/domain/models/OfferName'); describe('OfferName', function () { describe('OfferName.create factory', function () { it('Creates an Offer description containing a string', function () { O...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/offers/application/OffersAPI.test.js
ghost/core/test/unit/server/services/offers/application/OffersAPI.test.js
const sinon = require('sinon'); const assert = require('assert/strict'); const ObjectID = require('bson-objectid').default; const OffersAPI = require('../../../../../../core/server/services/offers/application/OffersAPI'); /** * @typedef {import('../../../../../../core/server/services/offers/OfferBookshelfRepository')...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/offers/application/UniqueChecker.test.js
ghost/core/test/unit/server/services/offers/application/UniqueChecker.test.js
const sinon = require('sinon'); const should = require('should'); const UniqueChecker = require('../../../../../../core/server/services/offers/application/UniqueChecker'); describe('UniqueChecker', function () { describe('#isUniqueCode', function () { it('Returns true if there is no Offer found in the repo...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/settings-helpers/settings-helpers.test.js
ghost/core/test/unit/server/services/settings-helpers/settings-helpers.test.js
const should = require('should'); const sinon = require('sinon'); const configUtils = require('../../../../utils/configUtils'); const SettingsHelpers = require('../../../../../core/server/services/settings-helpers/SettingsHelpers'); const crypto = require('crypto'); const assert = require('assert').strict; const mockV...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/settings/default-settings-manager.test.js
ghost/core/test/unit/server/services/settings/default-settings-manager.test.js
const sinon = require('sinon'); const should = require('should'); const fs = require('fs-extra'); const path = require('path'); const DefaultSettingsManager = require('../../../../../core/server/services/route-settings/DefaultSettingsManager'); describe('UNIT > Settings Service DefaultSettingsManager:', function () { ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/settings/settings-service.test.js
ghost/core/test/unit/server/services/settings/settings-service.test.js
const sinon = require('sinon'); const assert = require('assert/strict'); const configUtils = require('../../../../utils/configUtils'); const settingsCache = require('../../../../../core/shared/settings-cache'); const logging = require('@tryghost/logging'); describe('UNIT: Settings Service', function () { let setti...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/settings/settings-bread-service.test.js
ghost/core/test/unit/server/services/settings/settings-bread-service.test.js
const sinon = require('sinon'); const assert = require('assert/strict'); const mail = require('../../../../../core/server/services/mail'); const SettingsBreadService = require('../../../../../core/server/services/settings/SettingsBREADService'); const urlUtils = require('../../../../../core/shared/url-utils.js'); const...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/settings/settings-utils.test.js
ghost/core/test/unit/server/services/settings/settings-utils.test.js
const sinon = require('sinon'); const should = require('should'); describe('Unit: services/settings/settings-utils', function () { describe('getOrGenerateSiteUuid', function () { const config = require('../../../../../core/shared/config'); const logging = require('@tryghost/logging'); const...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/mentions/Mention.test.js
ghost/core/test/unit/server/services/mentions/Mention.test.js
const assert = require('assert/strict'); const ObjectID = require('bson-objectid').default; const cheerio = require('cheerio'); const sinon = require('sinon'); const Mention = require('../../../../../core/server/services/mentions/Mention'); const validInput = { source: 'https://source.com', target: 'https://t...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/mentions/ResourceService.test.js
ghost/core/test/unit/server/services/mentions/ResourceService.test.js
const assert = require('assert/strict'); const sinon = require('sinon'); const ResourceService = require('../../../../../core/server/services/mentions/ResourceService'); const UrlUtils = require('@tryghost/url-utils'); const UrlService = require('../../../../../core/server/services/url/UrlService'); function stubGetRe...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/mentions/MentionSendingService.test.js
ghost/core/test/unit/server/services/mentions/MentionSendingService.test.js
const MentionSendingService = require('../../../../../core/server/services/mentions/MentionSendingService'); const assert = require('assert/strict'); const nock = require('nock'); // non-standard to use externalRequest here, but this is required for the overrides in the libary, which we want to test for security reason...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/mentions/InMemoryMentionRepository.test.js
ghost/core/test/unit/server/services/mentions/InMemoryMentionRepository.test.js
const assert = require('assert/strict'); const ObjectID = require('bson-objectid').default; const InMemoryMentionRepository = require('../../../../../core/server/services/mentions/InMemoryMentionRepository'); const Mention = require('../../../../../core/server/services/mentions/Mention'); describe('InMemoryMentionRepo...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/mentions/MentionsAPI.test.js
ghost/core/test/unit/server/services/mentions/MentionsAPI.test.js
const assert = require('assert/strict'); const ObjectID = require('bson-objectid').default; const Mention = require('../../../../../core/server/services/mentions/Mention'); const MentionsAPI = require('../../../../../core/server/services/mentions/MentionsAPI'); const InMemoryMentionRepository = require('../../../../../...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/mentions/RoutingService.test.js
ghost/core/test/unit/server/services/mentions/RoutingService.test.js
const assert = require('assert/strict'); const sinon = require('sinon'); const nock = require('nock'); const ObjectID = require('bson-objectid').default; const externalRequest = require('../../../../../core/server/lib/request-external'); const RoutingService = require('../../../../../core/server/services/mentions/Rout...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/mentions/MentionDiscoveryService.test.js
ghost/core/test/unit/server/services/mentions/MentionDiscoveryService.test.js
const sinon = require('sinon'); const dnsPromises = require('dns').promises; const assert = require('assert/strict'); const nock = require('nock'); // non-standard to use externalRequest here, but this is required for the overrides in the library, which we want to test for security reasons in combination with the pack...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/mentions/utils/index.js
ghost/core/test/unit/server/services/mentions/utils/index.js
const ObjectId = require('bson-objectid').default; const createModel = (propertiesAndRelations) => { const id = propertiesAndRelations.id ?? ObjectId().toHexString(); return { id, getLazyRelation: (relation) => { propertiesAndRelations.loaded = propertiesAndRelations.loaded ?? []; ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/members-events/last-seen-at-cache.test.js
ghost/core/test/unit/server/services/members-events/last-seen-at-cache.test.js
const LastSeenAtCache = require('../../../../../core/server/services/members-events/LastSeenAtCache'); const assert = require('assert/strict'); const sinon = require('sinon'); const moment = require('moment-timezone'); describe('LastSeenAtCache', function () { let clock; before(function () { clock = si...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/members-events/event-storage.test.js
ghost/core/test/unit/server/services/members-events/event-storage.test.js
require('should'); const sinon = require('sinon'); const {MemberCreatedEvent, SubscriptionCreatedEvent} = require('../../../../../core/shared/events'); const EventStorage = require('../../../../../core/server/services/members-events/EventStorage'); describe('EventStorage', function () { describe('Constructor', fu...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/members-events/last-seen-at-updater.test.js
ghost/core/test/unit/server/services/members-events/last-seen-at-updater.test.js
const should = require('should'); const assert = require('assert/strict'); const sinon = require('sinon'); const LastSeenAtUpdater = require('../../../../../core/server/services/members-events/LastSeenAtUpdater'); const DomainEvents = require('@tryghost/domain-events'); const {MemberPageViewEvent, MemberCommentEvent, M...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
true
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/stripe/StripeAPI.test.js
ghost/core/test/unit/server/services/stripe/StripeAPI.test.js
const sinon = require('sinon'); const should = require('should'); const rewire = require('rewire'); const StripeAPI = rewire('../../../../../core/server/services/stripe/StripeAPI'); describe('StripeAPI', function () { const mockCustomerEmail = 'foo@example.com'; const mockCustomerId = 'cust_mock_123456'; c...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/stripe/config.test.js
ghost/core/test/unit/server/services/stripe/config.test.js
const should = require('should'); const sinon = require('sinon'); const UrlUtils = require('@tryghost/url-utils'); const configUtils = require('../../../../utils/configUtils'); const {getConfig} = require('../../../../../core/server/services/stripe/config'); function createSettingsHelpersMock() { return { ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/stripe/WebhookController.test.js
ghost/core/test/unit/server/services/stripe/WebhookController.test.js
const assert = require('assert/strict'); const sinon = require('sinon'); const WebhookController = require('../../../../../core/server/services/stripe/WebhookController'); describe('WebhookController', function () { let controller; let deps; let req; let res; beforeEach(function () { deps ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/stripe/Migrations.test.js
ghost/core/test/unit/server/services/stripe/Migrations.test.js
const assert = require('assert/strict'); const sinon = require('sinon'); const Migrations = require('../../../../../core/server/services/stripe/StripeMigrations'); describe('Migrations', function () { describe('updateStripeProductNamesFromDefaultProduct', function () { it('Does not run migration if api is ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/stripe/services/webhooks/CheckoutSessionEventService.test.js
ghost/core/test/unit/server/services/stripe/services/webhooks/CheckoutSessionEventService.test.js
const assert = require('assert/strict'); const errors = require('@tryghost/errors'); const sinon = require('sinon'); const CheckoutSessionEventService = require('../../../../../../../core/server/services/stripe/services/webhook/CheckoutSessionEventService'); describe('CheckoutSessionEventService', function () { l...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/stripe/services/webhooks/InvoiceEventService.test.js
ghost/core/test/unit/server/services/stripe/services/webhooks/InvoiceEventService.test.js
// const chai = require('chai'); const sinon = require('sinon'); // const {expect} = chai; const assert = require('assert/strict'); const errors = require('@tryghost/errors'); const InvoiceEventService = require('../../../../../../../core/server/services/stripe/services/webhook/InvoiceEventService'); describe('Invoic...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/stripe/services/webhooks/SubscriptionEventService.test.js
ghost/core/test/unit/server/services/stripe/services/webhooks/SubscriptionEventService.test.js
const sinon = require('sinon'); const assert = require('assert/strict'); const SubscriptionEventService = require('../../../../../../../core/server/services/stripe/services/webhook/SubscriptionEventService'); describe('SubscriptionEventService', function () { let service; let memberRepository; beforeEach...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/stats/referrers.test.js
ghost/core/test/unit/server/services/stats/referrers.test.js
const knex = require('knex').default; const assert = require('assert/strict'); const moment = require('moment-timezone'); const ReferrersStatsService = require('../../../../../core/server/services/stats/ReferrersStatsService'); const {DateTime} = require('luxon'); describe('ReferrersStatsService', function () { de...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
true
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/stats/mrr.test.js
ghost/core/test/unit/server/services/stats/mrr.test.js
const MrrStatsService = require('../../../../../core/server/services/stats/MrrStatsService'); const moment = require('moment'); const sinon = require('sinon'); const knex = require('knex').default; const should = require('should'); describe('MrrStatsService', function () { describe('getHistory', function () { ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/stats/members.test.js
ghost/core/test/unit/server/services/stats/members.test.js
const MembersStatsService = require('../../../../../core/server/services/stats/MembersStatsService'); const knex = require('knex').default; const assert = require('assert/strict'); const moment = require('moment'); const sinon = require('sinon'); describe('MembersStatsService', function () { describe('getCountHist...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/stats/stats.test.js
ghost/core/test/unit/server/services/stats/stats.test.js
const StatsService = require('../../../../../core/server/services/stats/StatsService'); const knex = require('knex').default; const assert = require('assert/strict'); describe('StatsService', function () { it('Exposes a create factory', function () { const service = StatsService.create({knex: knex({client:...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/test/unit/server/services/stats/subscriptions.test.js
ghost/core/test/unit/server/services/stats/subscriptions.test.js
const knex = require('knex').default; const assert = require('assert/strict'); const SubscriptionStatsService = require('../../../../../core/server/services/stats/SubscriptionStatsService'); describe('SubscriptionStatsService', function () { describe('getSubscriptionHistory', 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/server/services/stats/posts.test.js
ghost/core/test/unit/server/services/stats/posts.test.js
const knex = require('knex').default; const assert = require('assert/strict'); const moment = require('moment-timezone'); const PostsStatsService = require('../../../../../core/server/services/stats/PostsStatsService'); /** * @typedef {object} TestPost * @property {string} id * @property {string} title */ /** * ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
true