-
-
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
Optionally hide whitespace changes in diff #8626
Comments
@yassinecc Do you mean ignore spaces at beginning of line only? Hard to believe that |
Hello @pedrottimark, yes indeed. I see that you merged a related PR, did it address this issue? If so we can probably close this one |
@yassinecc To make a long story short, you can leave the issue open. This issue directly influenced refactoring and exporting Ignoring format indentation has been available when deep-equality matchers like const expectedLines2 = format(expected, {...formatOptions, indent: 2}).split('\n');
const receivedLines2 = format(received, {...formatOptions, indent: 2}).split('\n');
const expectedLines0 = format(expected, {...formatOptions, indent: 0}).split('\n');
const receivedLines0 = format(received, {...formatOptions, indent: 0}).split('\n');
const difference = diffLinesUnified2(
expectedLines2, // snapshot
receivedLines2,
expectedLines0, // not directly available for snapshot tests
receivedLines0,
); Unlike
|
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🚀 Feature Proposal
Add a CLI option to ignore whitespace changes when displaying diffs.
Motivation
When using Jest snapshots, Jest reports in case of failure the diff between expected and received outputs. In some cases, the snapshot is so large that adding a top level node in the snapshot results in a huge, unreadable diff (over say 10000 lines), while the change in itself is minimal.
Example
Would be nice to have an option like
jest --ignore-whitespace
Pitch
Why does this feature belong in the Jest core platform?
Common feature proposals that do not typically make it to core:
The text was updated successfully, but these errors were encountered: