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/globals): add missing options argument to jest.doMock typing #12292

Merged
merged 3 commits into from Feb 3, 2022

Conversation

mrazauskas
Copy link
Contributor

Fixes #12289

Summary

As it was noted in the issue, jest.doMock typing is missing options argument. Easy to fix.

Test plan

Type test is updated.


expectError(jest.doMock('moduleName', jest.fn(), {}));
expectError(jest.doMock('moduleName', jest.fn(), {virtual: true}));
expectType<typeof jest>(jest.doMock('moduleName', jest.fn(), {}));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Strange to allow empty object, but jest.mock is typed exactly the same.

Copy link
Contributor

@Biki-das Biki-das left a comment

Choose a reason for hiding this comment

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

looks good.

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 changed the title fix[@jest/globals]: add missing options argument to jest.doMock typing fix(@jest/globals): add missing options argument to jest.doMock typing Feb 3, 2022
@SimenB SimenB merged commit 71c1e93 into jestjs:main Feb 3, 2022
@mrazauskas mrazauskas deleted the fix-doMock-types branch February 3, 2022 07:12
@github-actions
Copy link

github-actions bot commented Mar 6, 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 Mar 6, 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.doMock type from @jest/globals lacks of optional options parameter
4 participants