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

docs: improve TypeScript Usage documentation with few additional notes #13601

Merged
merged 1 commit into from
Nov 11, 2022

Conversation

mrazauskas
Copy link
Contributor

@mrazauskas mrazauskas commented Nov 10, 2022

Closes #13598

Summary

A couple of improvements based on user feedback from the above mentioned issue:

  • currently the Getting Started guide is only telling to import from the @jest/globals package. The install step is missing. Let’s add it?
  • both TypeScript Usage sections are missing the note that types will work only if imported from @jest/globals. The note is on top of the page. That is right place to have it, also it is easy to skip it. Perhaps it is useful to repeat the note?

Test plan

Deploy preview

@AndreasNasman
Copy link

Thanks, looks great! 👍
Not sure if needed, but a note about explicitly adding @jest/globals locks down the version or similar could maybe be helpful.

@mrazauskas
Copy link
Contributor Author

Hm.. I think it is enough to document all necessary steps. Go this way and everything will work as expected.

Just above guide is suggesting to import babel-jest. From time to time users are suggesting to remove that line, because babel-jest ships with Jest anyways. Similar explanation would be useful there too. That’s why I feel like to keep it is fine to keep it simple.

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.

👍

@SimenB SimenB merged commit 6fc1860 into jestjs:main Nov 11, 2022
@mrazauskas mrazauskas deleted the docs-typescript-usage branch November 11, 2022 12:38
@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 Dec 12, 2022
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.

[Bug]: jest.fn cannot be overloaded with one generic
4 participants