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

Function expectTextSnapshot

src/testing/textSnapshotHarness.ts:30–38  ·  view source on GitHub ↗
(spec: TextSnapshotSpec)

Source from the content-addressed store, hash-verified

28}
29
30export function expectTextSnapshot(spec: TextSnapshotSpec): void {
31 const snapshotPath = fileURLToPath(spec.snapshotFileUrl)
32 const actual = formatTextSnapshot(spec)
33 if (process.env.UPDATE_TEXT_SNAPSHOTS === '1') {
34 writeFileSync(snapshotPath, actual, 'utf8')
35 }
36 const expected = normalizeSnapshotText(readFileSync(snapshotPath, 'utf8'))
37 expect(actual).toBe(expected)
38}

Calls 3

readFileSyncFunction · 0.90
formatTextSnapshotFunction · 0.85
normalizeSnapshotTextFunction · 0.85

Tested by 1

snapshotPaneFunction · 0.68