-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Diffs over 2048 characters are truncated even when there is no performance problem #4767
Comments
I have similar question - can it be disabled? Feature flag would be very helpful |
Also running into this, looks like its hardcoded to 2048 chars... |
Correct. At the very least that should be configurable. |
I think something like this would help in many cases (it certainly would in mine) and will be reasonably fast even for huge inputs. // truncate beginning of actual and expected strings until first difference if they exceed maxLen
const maxLen = 2048 // TODO: make this configurable :)
const len = Math.max(actual.length, expected.length)
let p = 0
while (len - p > maxLen && actual[p] === expected[p]) {
p++
}
actual = actual.slice(p, maxLen + p)
expected = expected.slice(p, maxLen + p) |
I have run into this several times so I took the liberty to create a pull request (see above). |
Reference: #4638
Can this be a feature flag please so it can be disabled? I was having NO speed issues before but now my test output is entirely broken (it doesn't show the actual diff at all) because it's a bit over 2000 characters.☹️
This arbitrary 2048 limit does not seem a good heuristic.
Originally posted by @joshgoebel in #4638 (comment)
The text was updated successfully, but these errors were encountered: