MCPcopy Create free account
hub / github.com/Noumena-Network/code / formatTextSnapshot

Function formatTextSnapshot

src/testing/textSnapshotHarness.ts:24–28  ·  view source on GitHub ↗
(spec: Omit<TextSnapshotSpec, 'snapshotFileUrl'>)

Source from the content-addressed store, hash-verified

22}
23
24export function formatTextSnapshot(spec: Omit<TextSnapshotSpec, 'snapshotFileUrl'>): string {
25 const normalizedValue = normalizeSnapshotText(spec.value)
26 const body = normalizedValue.endsWith('\n') ? normalizedValue : `${normalizedValue}\n`
27 return `---\nsource: ${spec.source}\nexpression: ${spec.expression}\n---\n${body}`
28}
29
30export function expectTextSnapshot(spec: TextSnapshotSpec): void {
31 const snapshotPath = fileURLToPath(spec.snapshotFileUrl)

Callers 1

expectTextSnapshotFunction · 0.85

Calls 1

normalizeSnapshotTextFunction · 0.85

Tested by

no test coverage detected