-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
jest-diff: Add trailingSpaceFormatter option and replace cyan with commonColor #8927
jest-diff: Add trailingSpaceFormatter option and replace cyan with commonColor #8927
Conversation
Codecov Report
@@ Coverage Diff @@
## master #8927 +/- ##
==========================================
- Coverage 64.28% 64.24% -0.05%
==========================================
Files 276 276
Lines 11716 11695 -21
Branches 2868 2863 -5
==========================================
- Hits 7532 7513 -19
+ Misses 3552 3550 -2
Partials 632 632
Continue to review full report at Codecov.
|
Baseline at left and improved at right default export from potentially confusing lines which differ only by indentation become
and Baseline at left and optional at right now it is possible for options to specify no colors const noColor = string => string;
const options = {
aColor: noColor,
bColor: noColor,
changeColor: noColor,
commonColor: noColor,
patchColor: noColor,
trailingSpaceFormatter: noColor,
}; |
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.
Nice, I like it!
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Make default export and
diffStringsUnified
display trailing spaces consistently:chalk.inverse
in changed lines, but it is ambiguous with formatting for changed substringschalk.bgYellow
in common lines, which becomes the default value of the option, unless y’all recommend something elsediffStringsUnified
used'·'
middle dot, but it is ambiguous with contentReplace
cyan
color withcommonColor
for lines that differ only by indentation when both values are objects (am studying how to do it for snapshots tests when received is object and snapshot is string)Residue
diffStringsUnified
replaces trimmable empty line at beginning or end of diff with'↵'
but default export does notdiffs.test.ts.snap
Test plan
expect
matchers.test.ts.snap
jest-diff
diffs.test.ts.snap
jest-matcher-utils
printDiffOrStringify.test.ts
jest-snapshot
printDiffOrStringified.test.ts
See also pictures in the following comment