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

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

Merged
merged 9 commits into from
Nov 29, 2021
Merged

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

merged 9 commits into from
Nov 29, 2021

Conversation

k-rajat19
Copy link
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

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
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
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
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
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
Contributor

mikemaccana commented Jan 5, 2022

For those a who came here from the warning:

velut added a commit to jsdocs-io/extractor that referenced this pull request Jan 17, 2022
boonya added a commit to boonya/rtsp-video-recorder that referenced this pull request Jan 24, 2022
boonya added a commit to boonya/rtsp-video-recorder that referenced this pull request Jan 24, 2022
* [Fixed][Issue #195] Using spaces in title results in ffmpeg error.

* Dev Dependencies bumped

* jest.mocked instead of ts-jest/mocked due to jestjs/jest#12089
boonya added a commit to boonya/react-hook-form-validation that referenced this pull request Jan 26, 2022
* All dependecies are up to date + jest.mocked instead of ts-jest mocked due to jestjs/jest#12089

* Example removed

* React Styleguidist first try

* Better documentation

* Styled documentation, changed min & max validators, removed special validators, workflows are tuned up

* Reusable docs workflow

* Reusable docs workflow fix

* Additional item in changelog

* Reusable docs workflow fix

* Validators refactored

* Invert validators result

* Readme

* min & length validators + integration test suites

* fix

* fix

* one more fix

* Exclude/ignore file(s) from Jest coverage by not running relevant tests

* fix

* code dublication avoided

* Seems work

* Bumped dependencies

* Docs
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 5, 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.

Include ts-jest mock util functions in jest core
6 participants