( actualSnapshot: string, expectedSnapshot: string, options: SnapshotOptions, )
| 91 | } |
| 92 | |
| 93 | export function getSnapshotNotMatchMessage( |
| 94 | actualSnapshot: string, |
| 95 | expectedSnapshot: string, |
| 96 | options: SnapshotOptions, |
| 97 | ) { |
| 98 | const stringDiff = !actualSnapshot.includes("\n"); |
| 99 | const diffResult = stringDiff |
| 100 | ? diffStr(actualSnapshot, expectedSnapshot) |
| 101 | : diff(actualSnapshot.split("\n"), expectedSnapshot.split("\n")); |
| 102 | const diffMsg = buildMessage(diffResult, { stringDiff }).join("\n"); |
| 103 | const message = |
| 104 | `Snapshot does not match:\n${diffMsg}\nTo update snapshots, run\n deno test --allow-read --allow-write [files]... -- --update\n`; |
| 105 | return getErrorMessage(message, options); |
| 106 | } |
| 107 | |
| 108 | // TODO (WWRS): Remove this when we drop support for Deno 1.x |
| 109 | export const LINT_SUPPORTED = !Deno.version.deno.startsWith("1."); |
no test coverage detected