Skip to content
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

Join lines with newline in jest-diff #4314

Merged
merged 2 commits into from
Aug 23, 2017

Conversation

pedrottimark
Copy link
Contributor

Summary

Join lines with newline instead of concatenating newline to each line, and then trimming result.

Is the trim method redundant? What about leading spaces? Glad you asked:

  • For default --colors option, ansi codes “protect” leading space if first line is unchanged.
  • For --no-colors option, leading space is trimmed. Inconsistent and seems like a bug.

Test plan

If you approve, I will update this PR:

  • delete 2 occurrences of trim method
  • update snapshot works with node assert in integration_tests/__tests__/failures.test.js
-    Object {
+      Object {
         "a": Object {
           "b": Object {
     -       "c": 6,
     +       "c": 5,
           },

-    Object {
+      Object {
         "a": Object {
           "b": Object {
     -       "c": 7,
     +       "c": 5,
           },

-    Object {
+      Object {
     -   "a": 2,
     +   "a": 1,
       }

@cpojer
Copy link
Member

cpojer commented Aug 23, 2017

works for me. Can you update the PR?

@pedrottimark
Copy link
Contributor Author

Yes, updated :)

@cpojer cpojer merged commit 53c0ccc into jestjs:master Aug 23, 2017
@pedrottimark pedrottimark deleted the jest-diff-newline branch August 23, 2017 16:43
@github-actions
Copy link

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants