(expected: Record<string, string>, received: Record<string, string>)
| 63 | } |
| 64 | |
| 65 | const headerDiffs = (expected: Record<string, string>, received: Record<string, string>) => |
| 66 | [...new Set([...Object.keys(expected), ...Object.keys(received)])].toSorted().flatMap((key) => { |
| 67 | if (expected[key] === received[key]) return [] |
| 68 | if (expected[key] === undefined) return [` ${key} unexpected ${safeText(received[key])}`] |
| 69 | if (received[key] === undefined) return [` ${key} missing expected ${safeText(expected[key])}`] |
| 70 | return [` ${key} expected ${safeText(expected[key])}, received ${safeText(received[key])}`] |
| 71 | }) |
| 72 | |
| 73 | export const requestDiff = (expected: RequestSnapshot, received: RequestSnapshot): ReadonlyArray<string> => { |
| 74 | const lines: string[] = [] |
no test coverage detected