( concatenatedBlockNames = '', hint = '', count: number, )
| 55 | // Display name in report when matcher fails same as in snapshot file, |
| 56 | // but with optional hint argument in bold weight. |
| 57 | const printSnapshotName = ( |
| 58 | concatenatedBlockNames = '', |
| 59 | hint = '', |
| 60 | count: number, |
| 61 | ): string => { |
| 62 | const hasNames = concatenatedBlockNames.length > 0; |
| 63 | const hasHint = hint.length > 0; |
| 64 | |
| 65 | return `Snapshot name: \`${ |
| 66 | hasNames ? escapeBacktickString(concatenatedBlockNames) : '' |
| 67 | }${hasNames && hasHint ? ': ' : ''}${ |
| 68 | hasHint ? BOLD_WEIGHT(escapeBacktickString(hint)) : '' |
| 69 | } ${count}\``; |
| 70 | }; |
| 71 | |
| 72 | function stripAddedIndentation(inlineSnapshot: string) { |
| 73 | // Find indentation if exists. |
no test coverage detected