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