Skip to content

adding ts-jest mock util functions in jest-mock#12089

Merged
SimenB merged 9 commits intojestjs:mainfrom
k-rajat19:temp
Nov 29, 2021
Merged

adding ts-jest mock util functions in jest-mock#12089
SimenB merged 9 commits intojestjs:mainfrom
k-rajat19:temp

Conversation

@k-rajat19
Copy link
Copy Markdown
Contributor

@k-rajat19 k-rajat19 commented Nov 25, 2021

Summary

This PR can close #9534 which was opened as a feature request by @ahnpnl

This PR includes -

there is also another proposal for partialMocked in kulshekhar/ts-jest#1065 which can be added after these changes are approved.

Any suggestions/ changes which can help in closing the above issue are most welcome.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Nov 25, 2021

Codecov Report

Merging #12089 (93234bd) into main (1f813fa) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #12089      +/-   ##
==========================================
- Coverage   68.89%   68.89%   -0.01%     
==========================================
  Files         324      324              
  Lines       16669    16672       +3     
  Branches     4814     4814              
==========================================
+ Hits        11484    11486       +2     
- Misses       5152     5153       +1     
  Partials       33       33              
Impacted Files Coverage Δ
packages/jest-mock/src/index.ts 85.09% <100.00%> (+0.10%) ⬆️
packages/expect/src/utils.ts 95.85% <0.00%> (-0.52%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1f813fa...93234bd. Read the comment docs.

@ahnpnl
Copy link
Copy Markdown
Contributor

ahnpnl commented Nov 25, 2021

Documentation https://github.com/facebook/jest/tree/main/docs would need to be updated as well as CHANGELOG too :)

@k-rajat19
Copy link
Copy Markdown
Contributor Author

k-rajat19 commented Nov 25, 2021

Typescript compiler is not able to validate definition files
this may be due to ts-jest type MockedFunction ?

@ahnpnl
Copy link
Copy Markdown
Contributor

ahnpnl commented Nov 25, 2021

The whole mocked from ts-jest relies partially on @types/jest. I think the TypeScript build failure is connected to that. Probably because @types/jest isn't a direct dependency of jest-mock package.

Copy link
Copy Markdown
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 ee24dfc into jestjs:main Nov 29, 2021
boonya added a commit to boonya/react-hook-form-validation that referenced this pull request Dec 18, 2021
@mikemaccana
Copy link
Copy Markdown
Contributor

mikemaccana commented Jan 5, 2022

For those a who came here from the warning:

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 5, 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.

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.

Include ts-jest mock util functions in jest core

6 participants