-
-
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
Configurable max diff size #4799
Conversation
Personally never ran into this issue, but I can see myself running into this in the future 👍 |
I have run into this multiple times, would really appreciate this getting more attention. |
@norla thank you for this PR. I'm not convinced of appending an additional option for this parameter. Usage:
|
@juergba makes sense, didn't know about reporter options until now :) Another thing I just thought of: |
1a88373
to
7704e22
Compare
@norla thank you, I will have a look this week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@norla please don't push commit by commit, our resources on the CI servers e.g. netlify are limited. |
@norla thank you so far. I will do some testing tomorrow. You could update this issue description (reporter-option / maxDiffSize, 2048=> 8192, fix message) and squash your commits. Edit: ... and rebase to |
Sure! I will try to do this (and the other stuff) later this weekend.
Den lör 12 feb. 2022 kl 09:59 skrev Juerg B. ***@***.***>:
… ***@***.**** commented on this pull request.
------------------------------
In test/reporters/base.spec.js
<#4799 (comment)>:
> });
it("should truncate overly long 'expected' ", function () {
+ var actual = 'a foo unified diff';
These tests don't cover the usage of reporter-option maxDiffSize=0. There
are similar tests for the spec and json reporters, indeed terrible tests.
Could you have a look and try to add one test, please?
—
Reply to this email directly, view it on GitHub
<#4799 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAYTYDP7DSBTHZNU7XEKJRLU2YON5ANCNFSM5KDG2BAQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I've fixed your comments. A bit unsure about the extra test but hopefully it should be enough. Let me know otherwise. |
@norla thank you very much! Please rebase/squash and mention the |
a1b68cd
to
e7b6b86
Compare
Description of the Change
Fixes #4767
Mocha truncates large diffs before displaying a readable unified/inline comparison.
This means that they are not displayed at all for larger strings in many cases, which causes confusion.
This PR makes the limit for when diffs should be truncated configurable (via "--reporter-option maxDiffSize=number"), so that projects that have large diffs can still get the outout they expect.
The default limit for generating diffs is also increased from 2048 to 8192 character, so that fewer people will run into this situation to begin with.
Also fixes bug causing the message about text being truncated to disappear.
Alternate Designs
Why should this be in core?
Fix for things already in core :)
Benefits
Configurable limit ensures that each project can configure the cropping of strings before shoving diff according to their own needs.
Possible Drawbacks
One more config flag to consider/document etc.
Applicable issues
#4767