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

feat: improve JSDocs for RenderOptions #909

Merged

Conversation

ImADrafter
Copy link
Contributor

What: Improve JS docs for type definitions, including JSDocs for RenderOptions.

Im just not sure if docs commit type is the proper for this one

Why: While using react-testing library, sometimes you will need to review the docs. By filling props description with just a brief stract of the docs, the library would be easier to use for IDEs with JSDoc support, specially for newcommers.

How: JSDocs syntax

Checklist:

  • Documentation added to the
    docs site
  • Tests
  • Typescript definitions updated
  • Ready to be merged

@codesandbox-ci
Copy link

codesandbox-ci bot commented May 11, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 4f419ec:

Sandbox Source
React Configuration
react-testing-library-examples Configuration

Copy link
Member

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

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

Awesome. Really looking forward to having more in-editor docs. I have some minor wording/formatting suggestions.

types/index.d.ts Outdated Show resolved Hide resolved
types/index.d.ts Outdated Show resolved Hide resolved
types/index.d.ts Outdated Show resolved Hide resolved
types/index.d.ts Outdated Show resolved Hide resolved
types/index.d.ts Outdated Show resolved Hide resolved
types/index.d.ts Outdated
/** If the container is specified, then this defaults to that, otherwise this defaults to document.body. This is used as
* the base element for the queries as well as what is printed when you use debug().
*
* [BaseElement](https://testing-library.com/docs/react-testing-library/api/#baseelement)
Copy link
Member

Choose a reason for hiding this comment

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

Not a fan of these non-descriptive links. What do you think about just

Suggested change
* [BaseElement](https://testing-library.com/docs/react-testing-library/api/#baseelement)
* @see https://testing-library.com/docs/react-testing-library/api/#baseelement

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm what do you think about this @links ? The think with @see is that you loose the hyperlink on the hint :( @eps1lon

Copy link
Member

Choose a reason for hiding this comment

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

The think with @see is that you loose the hyperlink on the hint :(

Will check. I was under the impression VSCode did make these clickable.

Copy link
Member

@eps1lon eps1lon Sep 11, 2021

Choose a reason for hiding this comment

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

Just checked the links and they all work without any JSDoc tags. Will just use @see tags.

ImADrafter and others added 2 commits May 22, 2021 14:04
Co-authored-by: Sebastian Silbermann <silbermann.sebastian@gmail.com>
@ImADrafter ImADrafter force-pushed the improve-render-options-jsdocs branch from 624b86c to 94b04f2 Compare May 22, 2021 12:05
3imed-jaberi
3imed-jaberi previously approved these changes Jul 18, 2021
Copy link

@3imed-jaberi 3imed-jaberi left a comment

Choose a reason for hiding this comment

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

+1

@eps1lon eps1lon changed the title docs: improve JSDocs for RenderOptions feat: improve JSDocs for RenderOptions Sep 11, 2021
@codecov
Copy link

codecov bot commented Sep 11, 2021

Codecov Report

Merging #909 (4f419ec) into main (071a6fd) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #909   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines          140       140           
  Branches        28        28           
=========================================
  Hits           140       140           

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 071a6fd...4f419ec. Read the comment docs.

@eps1lon eps1lon merged commit fbacb0d into testing-library:main Sep 11, 2021
@eps1lon
Copy link
Member

eps1lon commented Sep 11, 2021

@ImADrafter Much appreciated, thanks!

@all-contributors add @ImADrafter for docs

@allcontributors
Copy link
Contributor

@eps1lon

I've put up a pull request to add @ImADrafter! 🎉

@github-actions
Copy link

🎉 This PR is included in version 12.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants