(spec: Omit<TextSnapshotSpec, 'snapshotFileUrl'>)
| 22 | } |
| 23 | |
| 24 | export 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 | |
| 30 | export function expectTextSnapshot(spec: TextSnapshotSpec): void { |
| 31 | const snapshotPath = fileURLToPath(spec.snapshotFileUrl) |
no test coverage detected