-
-
Notifications
You must be signed in to change notification settings - Fork 225
Feature: toEqualIgnoringWhitespace. Check if two strings are equal irrespective of white-spaces and provide hints if not #266
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #266 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 132 112 -20
Lines 780 570 -210
Branches 130 99 -31
==========================================
- Hits 780 570 -210
Continue to review full report at Codecov.
|
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.
Sorry about no response!
Could you rebase this?
package.json
Outdated
"pretty-format": "^22.1.0" | ||
}, | ||
"dependencies": { | ||
"diff": "^4.0.2", |
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.
could we use jest-diff
instead?
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.
Yes, we can. Changed and added few more changes.
@SimenB Please review
4e9670a
to
0868059
Compare
d662eeb
to
9f349e1
Compare
9f349e1
to
e8b691d
Compare
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, thanks!
What
New feature: Test if two strings are equal, ignoring whitespaces in both string.
And if the strings are not similar, provide hints to user regarding the differences in strings with color coding.
Why
Very often we are asserting over SQL queries, JS code, CSS rules, etc which is very cumbersome due to spaces and newlines. If the strings differs, then it is very hard to rectify the expected string without any hint.
Notes
Added new npm dependency
diff
to calculate differences in strings.Housekeeping