renovate/test/newline-snapshot-serializer.ts
Michael Kriese 6474dd49e5
chore: lint fixes (#7018)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2020-08-19 06:46:00 +02:00

14 lines
407 B
TypeScript

let prev: string;
// this does not work as intended
// see https://jestjs.io/docs/en/configuration#snapshotserializers-arraystring
export function print(val: string): string {
return JSON.stringify(val);
}
export function test(val: string): boolean {
if (['prBody', 'prTitle'].some((str) => str === prev)) {
return typeof val === 'string' && val.includes('\n');
}
prev = val;
return false;
}