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

Flatten temporary data structures in jest-diff #4469

Merged
merged 2 commits into from
Sep 12, 2017

Conversation

pedrottimark
Copy link
Contributor

Summary

Improve in small ways now and mainly reduce complexity of code diff in future pull request.

  • For Diff replace {diff: string, isDifferent: boolean} with string | null

  • In formatChunks and formatHunks return if no differences before initializing variables

  • In formatChunks replace map with reduce to eliminate some string concatenation and mainly be able in the future to display differences within adjacent pairs of removed and added chunks

Test plan

Existing tests verify no change to behavior of package.

@codecov-io
Copy link

Codecov Report

Merging #4469 into master will decrease coverage by 0.02%.
The diff coverage is 94.73%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4469      +/-   ##
==========================================
- Coverage   56.86%   56.84%   -0.03%     
==========================================
  Files         186      186              
  Lines        6299     6298       -1     
  Branches        3        3              
==========================================
- Hits         3582     3580       -2     
- Misses       2716     2717       +1     
  Partials        1        1
Impacted Files Coverage Δ
packages/jest-diff/src/diff_strings.js 98.88% <94.73%> (-1.12%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 72af99d...b2d3de7. Read the comment docs.

@cpojer cpojer merged commit c4844a6 into jestjs:master Sep 12, 2017
@pedrottimark pedrottimark deleted the flatten-jest-diff branch September 13, 2017 01:09
tabrindle pushed a commit to tabrindle/jest that referenced this pull request Oct 2, 2017
@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.

None yet

4 participants