Function
printReceivedArrayContainExpectedItem
(
received: Array<unknown>,
index: number,
)
Source from the content-addressed store, hash-verified
| 45 | // However, items have default stringify depth (instead of depth - 1) |
| 46 | // so expected item looks consistent by itself and enclosed in the array. |
| 47 | export const printReceivedArrayContainExpectedItem = ( |
| 48 | received: Array<unknown>, |
| 49 | index: number, |
| 50 | ): string => |
| 51 | RECEIVED_COLOR( |
| 52 | `[${received |
| 53 | .map((item, i) => { |
| 54 | const stringified = stringify(item); |
| 55 | return i === index ? INVERTED_COLOR(stringified) : stringified; |
| 56 | }) |
| 57 | .join(', ')}]`, |
| 58 | ); |
| 59 | |
| 60 | export const printCloseTo = ( |
| 61 | receivedDiff: number, |
Tested by
no test coverage detected