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-docblock] Preserve leading whitespace in docblock comments #4576

Merged
merged 1 commit into from
Oct 1, 2017

Conversation

azz
Copy link
Contributor

@azz azz commented Oct 1, 2017

Follow-up to #4517.

Summary

I noticed the regular expressions used to trim down the docblock were trimming out some useful information: leading whitespace.

/**
 * foo()
 *   .bar()
 */

require('jest-docblock').parseWithComments(...).comments was being producing

foo()
.bar()

This PR preserves all but the first, if present space on each line, such that the output is:

foo()
  .bar()

Test plan

Unit tests added and passing.

@codecov-io
Copy link

Codecov Report

Merging #4576 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4576   +/-   ##
=======================================
  Coverage   55.61%   55.61%           
=======================================
  Files         186      186           
  Lines        6354     6354           
  Branches        3        3           
=======================================
  Hits         3534     3534           
  Misses       2819     2819           
  Partials        1        1
Impacted Files Coverage Δ
packages/jest-docblock/src/index.js 100% <100%> (ø) ⬆️

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 ec87e1f...c0c2ad7. Read the comment docs.

@cpojer cpojer merged commit 6e5d149 into jestjs:master Oct 1, 2017
@cpojer
Copy link
Member

cpojer commented Oct 1, 2017

That works!

@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.

4 participants