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

jest-diff: Remove the need to export splitLines0 function #9151

Merged
merged 4 commits into from
Nov 8, 2019

Conversation

pedrottimark
Copy link
Contributor

Summary

Let callers of diffLinesUnified and diffLinesUnified2 use split method, because it is a private implementation issue that ''.split('\n') is [''] instead of []

But callers of diffLinesRaw must decide whether [''] or [] has correct meaning for their applications

In README.md file, move information:

  • from Edge cases of diffLinesUnified or diffStringsUnified
  • to Edge case of diffLinesRaw

This is not a breaking change, because the export was never published

Test plan

In diff.tests.ts

  • Added 8 tests to diff.test.ts to cover new conditions
  • Added 2 tests to close previous gap in code coverage
  • Edited 1 describe to replace obsolete firstOrLastEmptyLineReplacement with emptyFirstOrLastLinePlaceholder default empty string

@codecov-io
Copy link

Codecov Report

Merging #9151 into master will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9151      +/-   ##
==========================================
+ Coverage   64.77%   64.81%   +0.04%     
==========================================
  Files         277      277              
  Lines       11724    11730       +6     
  Branches     2879     2881       +2     
==========================================
+ Hits         7594     7603       +9     
+ Misses       3512     3511       -1     
+ Partials      618      616       -2
Impacted Files Coverage Δ
packages/jest-diff/src/index.ts 81.48% <100%> (ø) ⬆️
packages/jest-diff/src/diffLines.ts 100% <100%> (+4.76%) ⬆️
packages/jest-snapshot/src/printSnapshot.ts 100% <100%> (ø) ⬆️
packages/jest-diff/src/printDiffs.ts 100% <100%> (ø) ⬆️
...s/jest-core/src/lib/handle_deprecation_warnings.ts 0% <0%> (ø) ⬆️
packages/jest-environment-node/src/index.ts 57.14% <0%> (+0.38%) ⬆️

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 bbfef53...bfe338e. Read the comment docs.

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wonderful 👍

@pedrottimark pedrottimark merged commit e00ec07 into jestjs:master Nov 8, 2019
@pedrottimark pedrottimark deleted the diff-splitLines0 branch November 8, 2019 18:59
@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 11, 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.

4 participants