71
72
if (normalizeCrlf(expected) !== normalizeCrlf(actual)) {
73
>
await __writeFileInTests(fpath + '.actual', actual);
snapshot.ts
74
>
const err: any = new Error(`Snapshot #${nameOrIndex} does not match expected output`);
75
>
err.expected = expected;
76
>
err.actual = actual;
77
>
err.snapshotPath = fpath;
78
>
err.stack = (err.stack as string)
79
>
.split('\n')
80
>
// remove all frames from the async stack and keep the original caller's frame
81
>
.slice(0, 1)
82
>
.concat(originalStack.split('\n').slice(3))
83
>
.join('\n');
84
>
throw err;
85
>
}
86
}
87