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

chore(docs): add readme to jest-types #12791

Merged
merged 7 commits into from May 3, 2022
Merged

chore(docs): add readme to jest-types #12791

merged 7 commits into from May 3, 2022

Conversation

rethab
Copy link
Contributor

@rethab rethab commented May 2, 2022

No description provided.

this is to clarify the difference between @types/jest and @jest/types, see #9972
@facebook-github-bot
Copy link
Contributor

Hi @rethab!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@SimenB
Copy link
Member

SimenB commented May 2, 2022

Thanks! We do support types if you import @jest/globals, maybe mention it?

@mrazauskas thoughts?

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

packages/jest-types/README.md Outdated Show resolved Hide resolved
packages/jest-types/README.md Outdated Show resolved Hide resolved
@mrazauskas
Copy link
Contributor

mrazauskas commented May 2, 2022

@rethab Left a couple of comments. Just drafting. Feel free to rework (;

As an example, jest.useFakeTimers() (see #12572) are not yet correctly typed in @types/jest (unless something changed recently). The idea which I am trying to promote is that importing types will always provide up to date types of current installed version.

rethab and others added 3 commits May 3, 2022 09:07
Co-authored-by: Tom Mrazauskas <tom@mrazauskas.de>
Co-authored-by: Tom Mrazauskas <tom@mrazauskas.de>
@rethab
Copy link
Contributor Author

rethab commented May 3, 2022

Thanks @mrazauskas and @SimenB I have incorporated all suggestions :)

@SimenB
Copy link
Member

SimenB commented May 3, 2022

Sorry @rethab, one more thing 😅

One thing @jest/types might be used for directly is to type Jest config. I.e.

// jest.config.ts
import {Config} from '@jest/types';

const config: Config.InitialOptions = {
  // some typed config
};

export default config;

Could we add a mention of that?

@mrazauskas
Copy link
Contributor

Thank you for fixing grammar. All looks good for me.

@rethab
Copy link
Contributor Author

rethab commented May 3, 2022

Sorry @rethab, one more thing 😅

One thing @jest/types might be used for directly is to type Jest config. I.e.

// jest.config.ts
import {Config} from '@jest/types';

const config: Config.InitialOptions = {
  // some typed config
};

export default config;

Could we add a mention of that?

No worries, I've added that.

But while we're at it, why does jest not provide those types? Would it be possible to export them for users to consume?

@mrazauskas
Copy link
Contributor

But while we're at it, why does jest not provide those types? Would it be possible to export them for users to consume?

Good question. I have one super simple idea regarding config types. Will just do it now ;D

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.

thanks!

@SimenB SimenB merged commit 585854f into jestjs:main May 3, 2022
@rethab rethab deleted the patch-1 branch May 3, 2022 07:58
@github-actions
Copy link

github-actions bot commented Jun 3, 2022

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 Jun 3, 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.

None yet

4 participants