MCPcopy
hub / github.com/TryGhost/Ghost / assertExists

Function assertExists

ghost/core/test/utils/assertions.js:12–17  ·  view source on GitHub ↗

* @template T * @param {T} value * @param {string} [message] * @returns {asserts value is NonNullable }

(value, message = 'Value should exist')

Source from the content-addressed store, hash-verified

10 * @returns {asserts value is NonNullable<T>}
11 */
12function assertExists(value, message = 'Value should exist') {
13 assert(
14 (value !== undefined) && (value !== null),
15 message
16 );
17}
18
19function assertMatchSnapshot(obj, properties) {
20 const result = snapshotManager.match(obj, properties);

Callers 15

v2.test.jsFile · 0.85
exporter.test.jsFile · 0.85
tags.test.jsFile · 0.85
posts.test.jsFile · 0.85
schedules.test.jsFile · 0.85
identities.test.jsFile · 0.85
checkCanEditFunction · 0.85
settings.test.jsFile · 0.85
db.test.jsFile · 0.85

Calls 1

assertFunction · 0.85

Tested by 15

checkCanEditFunction · 0.68
assertCorrectHeadersFunction · 0.68
shouldRenderToExpectedFunction · 0.68
testGhostHeadFunction · 0.68
failTestFunction · 0.68
assertImageObjectFunction · 0.68
testInvalidSettingFunction · 0.68
loginAsMemberFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…