(originalActual, actual, originalExpected, expected)
| 153 | } |
| 154 | |
| 155 | function getSimpleDiff(originalActual, actual, originalExpected, expected) { |
| 156 | let stringsLen = actual.length + expected.length; |
| 157 | // Accounting for the quotes wrapping strings |
| 158 | if (typeof originalActual === 'string') { |
| 159 | stringsLen -= 2; |
| 160 | } |
| 161 | if (typeof originalExpected === 'string') { |
| 162 | stringsLen -= 2; |
| 163 | } |
| 164 | if (stringsLen <= kMaxShortStringLength && (originalActual !== 0 || originalExpected !== 0)) { |
| 165 | return { message: `${actual} !== ${expected}`, header: '' }; |
| 166 | } |
| 167 | |
| 168 | const isStringComparison = typeof originalActual === 'string' && typeof originalExpected === 'string'; |
| 169 | // colored myers diff |
| 170 | if (isStringComparison && colors.hasColors) { |
| 171 | return getColoredMyersDiff(actual, expected); |
| 172 | } |
| 173 | |
| 174 | return getStackedDiff(actual, expected); |
| 175 | } |
| 176 | |
| 177 | function isSimpleDiff(actual, inspectedActual, expected, inspectedExpected) { |
| 178 | if (inspectedActual.length > 1 || inspectedExpected.length > 1) { |
no test coverage detected
searching dependent graphs…