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

fix(jest-mock): add index signature support for spyOn types #13013

Merged
merged 3 commits into from
Jul 13, 2022
Merged

fix(jest-mock): add index signature support for spyOn types #13013

merged 3 commits into from
Jul 13, 2022

Conversation

mrazauskas
Copy link
Contributor

@mrazauskas mrazauskas commented Jul 13, 2022

Fixes #13012
Adapted from https://github.com/DefinitelyTyped/DefinitelyTyped/pull/60971/files

Summary

As it is explained in the linked issue (and also #12966), currently spyOn types do not handle index signatures. Thanks to @Maxim-Mazurok, a fix landed in @types/jest. Here I adapted it for Jest types to make it work through import {jest} from '@jest/globals'.

@Maxim-Mazurok could you take a look, please? (;

Test plan

Type tests are added. They are failing on main, but should pass on this branch.

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 f87e4c3 into jestjs:main Jul 13, 2022
@Maxim-Mazurok
Copy link
Contributor

Thank you!

@SimenB
Copy link
Member

SimenB commented Jul 13, 2022

https://github.com/facebook/jest/releases/tag/v28.1.3

@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 Aug 13, 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/globals doesn't use spyOn() from @types/jest
4 participants