Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update TypeScript example to show use of newer Jest types #10399

Merged
merged 4 commits into from
Oct 30, 2020
Merged

Update TypeScript example to show use of newer Jest types #10399

merged 4 commits into from
Oct 30, 2020

Conversation

sheepsteak
Copy link
Contributor

@sheepsteak sheepsteak commented Aug 12, 2020

Summary

There have been some updates to Jest's separate @types/jest (started here I think - DefinitelyTyped/DefinitelyTyped#37173) that are very useful and I thought I'd update the TypeScript example to show how they can be used.

- [x] Remove @types/jest from root package.json (not needed I think and child packages state @types/jest: "*" anyway
- [x] Update @types/jest in yarn.lock to 24.9.0 that includes MockedFunction and MockedClass

  • Update TypeScript example

Test plan

yarn.lock Outdated
Comment on lines 3464 to 3465
jest-diff: ^25.2.1
pretty-format: ^25.2.1
Copy link
Member

Choose a reason for hiding this comment

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

why are these on 25? 🤔

package.json Outdated
@@ -16,7 +16,6 @@
"@types/babel__generator": "^7.0.0",
"@types/babel__template": "^7.0.0",
"@types/dedent": "0.7.0",
"@types/jest": "24.0.2",
Copy link
Member

Choose a reason for hiding this comment

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

this is intentionally lower to make sure we don't pull in a version with dependencies - it causes "race" conditions when compiling since @types/jest tries to load the types of jest-diff which haven't been built yet.

Allowing the * one to stay at 26 might work, not sure

Copy link
Member

Choose a reason for hiding this comment

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

we might be able to fix it by having some sort of types exclusion? not sure

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've just realised that the MockedFunction type I wanted to show is actually in 24.9.0. So I've added that back in and removed the 26.

@SimenB
Copy link
Member

SimenB commented Oct 29, 2020

@sheepsteak sorry about forgetting about this PR. I just landed #10732, so if your rebase this on master we should be good to land it 🙂

@sheepsteak
Copy link
Contributor Author

@SimenB, no problem! I've rebased on master. I was able to remove my bump of @types/jest as you're using a newer version now anyway.

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!

This was referenced Mar 15, 2021
@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
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants