-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
Documentation https://github.com/facebook/jest/tree/main/docs would need to be updated as well as CHANGELOG too :) |
Typescript compiler is not able to validate definition files |
The whole |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
For those a who came here from the warning:
|
1480: chore: update dependency @types/react to v16.14.21 r=renovate[bot] a=renovate[bot] [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [`@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped)` | [`16.9.56` -> `16.14.21`](https://renovatebot.com/diffs/npm/`@types%2freact/16.9.56/16.14.21)` | [![age](https://badges.renovateapi.com/packages/npm/`@types%2freact/16.14.21/age-slim)](https://docs.renovatebot.com/merge-confidence/)` | [![adoption](https://badges.renovateapi.com/packages/npm/`@types%2freact/16.14.21/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)` | [![passing](https://badges.renovateapi.com/packages/npm/`@types%2freact/16.14.21/compatibility-slim/16.9.56)](https://docs.renovatebot.com/merge-confidence/)` | [![confidence](https://badges.renovateapi.com/packages/npm/`@types%2freact/16.14.21/confidence-slim/16.9.56)](https://docs.renovatebot.com/merge-confidence/)` | --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/foosbyte/kicker-trainer). 1481: chore: update dependency ts-jest to v27.1.3 r=renovate[bot] a=renovate[bot] [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [ts-jest](https://kulshekhar.github.io/ts-jest) ([source](https://github.com/kulshekhar/ts-jest)) | [`27.0.7` -> `27.1.3`](https://renovatebot.com/diffs/npm/ts-jest/27.0.7/27.1.3) | [![age](https://badges.renovateapi.com/packages/npm/ts-jest/27.1.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/ts-jest/27.1.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/ts-jest/27.1.3/compatibility-slim/27.0.7)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/ts-jest/27.1.3/confidence-slim/27.0.7)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>kulshekhar/ts-jest</summary> ### [`v27.1.3`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#​2713-httpsgithubcomkulshekharts-jestcomparev2712v2713-2022-01-14) [Compare Source](https://github.com/kulshekhar/ts-jest/compare/v27.1.2...v27.1.3) ##### Bug Fixes - **compiler:** update memory cache for compiler using received file content ([#​3194](https://github.com/kulshekhar/ts-jest/issues/3194)) ([e4d9541](https://github.com/kulshekhar/ts-jest/commit/e4d9541f262ca14cb25563c757c0f2345dbf5c51)) ### [`v27.1.2`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#​2712-httpsgithubcomkulshekharts-jestcomparev2711v2712-2021-12-15) [Compare Source](https://github.com/kulshekhar/ts-jest/compare/v27.1.1...v27.1.2) ##### Bug Fixes - stimulate `esbuild` type to avoid importing `esbuild` directly ([#​3147](https://github.com/kulshekhar/ts-jest/issues/3147)) ([9ace0a9](https://github.com/kulshekhar/ts-jest/commit/9ace0a9991da8bcb0f04a2e603f7601d6fb630e7)) ### [`v27.1.1`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#​2711-httpsgithubcomkulshekharts-jestcomparev2710v2711-2021-12-07) [Compare Source](https://github.com/kulshekhar/ts-jest/compare/v27.1.0...v27.1.1) ##### Bug Fixes - bring back `afterProcess` hook ([#​3132](https://github.com/kulshekhar/ts-jest/issues/3132)) ([2b6b86e](https://github.com/kulshekhar/ts-jest/commit/2b6b86e01dcd3d9d9906f24fe3db5cadb799146a)) - make `esbuild` as optional peer dependency ([#​3129](https://github.com/kulshekhar/ts-jest/pull/3129)) ([20258de](https://github.com/kulshekhar/ts-jest/commit/20258de54c9c10f8d2495bda174f9865a3cebc91)) ### [`v27.1.0`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#​2710-httpsgithubcomkulshekharts-jestcomparev2707v2710-2021-11-30) [Compare Source](https://github.com/kulshekhar/ts-jest/compare/v27.0.7...v27.1.0) ##### Features - allow subclasses to extend `processAsync` and `getCacheKeyAsync` ([#​3047](https://github.com/kulshekhar/ts-jest/issues/3047)) ([571a880](https://github.com/kulshekhar/ts-jest/commit/571a880007642c9dcbcd7bf109c5392e7eb78cc4)) - **config:** support custom AST transformers written in TypeScript ([#​3063](https://github.com/kulshekhar/ts-jest/issues/3063)) ([340a305](https://github.com/kulshekhar/ts-jest/commit/340a30573e5ff92df77c94af51c371ce4bf956e7)), closes [#​2831](https://github.com/kulshekhar/ts-jest/issues/2831) - export `ts-jest` public apis from `index.js` ([#​3080](https://github.com/kulshekhar/ts-jest/issues/3080)) ([53175dd](https://github.com/kulshekhar/ts-jest/commit/53175dd04218bf22ead464e30aa01b258c87e7af)), closes [#​3045](https://github.com/kulshekhar/ts-jest/issues/3045) ##### Code Refactoring - **utils:** deprecate `mocked` util function ([#​3102](https://github.com/kulshekhar/ts-jest/issues/3102)) ([55e69f1](https://github.com/kulshekhar/ts-jest/commit/55e69f12f65d678962c3087fca7673992f5f1b26)) - define clear type for `compiler` option ([#​3087](https://github.com/kulshekhar/ts-jest/issues/3087)) ([cc42daf](https://github.com/kulshekhar/ts-jest/commit/cc42daf795585887664be59956d2c52244237bda)) - **transformers**: deprecate `path-mapping` AST transformer ([#​3088](https://github.com/kulshekhar/ts-jest/issues/3088)) ([d8f6b96](https://github.com/kulshekhar/ts-jest/commit/d8f6b9624ee76a164aa7003720cd3f83fc6c4865)) - **transformers**: use ts `factory` API for `hoisting` AST transformer ([#​3058](https://github.com/kulshekhar/ts-jest/issues/3058)) ([a72f51d](https://github.com/kulshekhar/ts-jest/commit/a72f51d9b7c4ea2866e486c0aac4f4706c3ed542)) #### DEPRECATIONS - **transformers**: `path-mapping` AST transformer is deprecated and will be removed in **v28.0.0**. One should use an alternative one like https://github.com/LeDDGroup/typescript-transform-paths instead. - **utils**: `mocked` function is deprecated and will be removed in **v28.0.0**. The function has been integrated into `jest-mock` package as a part of Jest **27.4.0**, see [https://github.com/facebook/jest/pull/12089](https://github.com/facebook/jest/pull/12089). One should use the one from Jest instead #### [27.0.7](https://github.com/kulshekhar/ts-jest/compare/v27.0.6...v27.0.7) (2021-10-16) ##### Bug Fixes - correct `lodash` import ([#​2978](https://github.com/kulshekhar/ts-jest/issues/2978)) ([8b60679](https://github.com/kulshekhar/ts-jest/commit/8b60679574eb60a3c8109ffd389b64b86a167e72)), closes [#​2977](https://github.com/kulshekhar/ts-jest/issues/2977) #### [27.0.6](https://github.com/kulshekhar/ts-jest/compare/v27.0.5...v27.0.6) (2021-10-14) ##### Bug Fixes - use specific `lodash` package instead of full package `lodash` ([#​2959](https://github.com/kulshekhar/ts-jest/issues/2959)) ([dc89fe5](https://github.com/kulshekhar/ts-jest/commit/dc89fe55f2b77da76443f827fe3055f07cf4809c)), closes [#​2954](https://github.com/kulshekhar/ts-jest/issues/2954) #### [27.0.5](https://github.com/kulshekhar/ts-jest/compare/v27.0.4...v27.0.5) (2021-08-14) ##### Bug Fixes - **cli:** add migration `tsConfig` option for `ts-jest` config options ([#​2794](https://github.com/kulshekhar/ts-jest/issues/2794)) ([781710b](https://github.com/kulshekhar/ts-jest/commit/781710bf6b84853fffbb02543062a726fe1ad9c2)), closes [#​2764](https://github.com/kulshekhar/ts-jest/issues/2764) - **cli:** fix `config:init` genarate invalid type comment ([#​2773](https://github.com/kulshekhar/ts-jest/issues/2773)) ([ede8a20](https://github.com/kulshekhar/ts-jest/commit/ede8a2061e20b717c0d56e4d81a3cd0ec7db8b1a)), closes [#​2772](https://github.com/kulshekhar/ts-jest/issues/2772) - **config:** handle `./` in tsconfig `paths` for `pathsToModuleNameMapper` ([#​2797](https://github.com/kulshekhar/ts-jest/issues/2797)) ([42ff5e4](https://github.com/kulshekhar/ts-jest/commit/42ff5e469fb5d315b92e85eee105e5a040949c01)), closes [#​2709](https://github.com/kulshekhar/ts-jest/issues/2709) ##### Code Refactoring - use native `Buffer.from` and `mkdird` ([#​2774](https://github.com/kulshekhar/ts-jest/issues/2774)) ([4869660](https://github.com/kulshekhar/ts-jest/commit/4869660e3917deb063745c5acaf079123d6d2ca8)) #### [27.0.4](https://github.com/kulshekhar/ts-jest/compare/v27.0.3...v27.0.4) (2021-07-21) ##### Bug Fixes - add ``@types/jest`` as optional `peerDependencies` to solve yarn 2 ([#​2756](https://github.com/kulshekhar/ts-jest/issues/2756)) ([5fbf43e](https://github.com/kulshekhar/ts-jest/commit/5fbf43e64691d5146add1da4690a14b3095c4234)) - add `babel-jest` as optional `peerDependencies` to solve yarn 2 ([#​2751](https://github.com/kulshekhar/ts-jest/issues/2751)) ([8bede2e](https://github.com/kulshekhar/ts-jest/commit/8bede2e57546a18999b96871069f1f94a3ecf3c1)) - **config:** include AST transformer's `name` and `version` into cache key ([#​2755](https://github.com/kulshekhar/ts-jest/issues/2755)) ([310fb9a](https://github.com/kulshekhar/ts-jest/commit/310fb9a1d7b40a8274d6fb93745e66a6da891a75)), closes [#​2753](https://github.com/kulshekhar/ts-jest/issues/2753) ##### Features - link jest config types on `npx ts-jest:init` ([#​2742](https://github.com/kulshekhar/ts-jest/issues/2742)) ([f51ba05](https://github.com/kulshekhar/ts-jest/commit/f51ba0507568ba8a5dece48c159d7857a2ed61d6)) - set env var `TS_JEST` to allow detecting of `ts-jest` ([#​2717](https://github.com/kulshekhar/ts-jest/issues/2717)) ([56c137a](https://github.com/kulshekhar/ts-jest/commit/56c137a3c1906f49cb0b9e044fa8e233707cbaa4)), closes [#​2716](https://github.com/kulshekhar/ts-jest/issues/2716) #### [27.0.3](https://github.com/kulshekhar/ts-jest/compare/v27.0.2...v27.0.3) (2021-06-06) ##### Bug Fixes - revert `exports` field to support all node versions ([#​2658](https://github.com/kulshekhar/ts-jest/issues/2658)) ([132c8ba](https://github.com/kulshekhar/ts-jest/commit/132c8ba85c3e61b7d9ede0dc9730580b79618ab7)) ##### Features - emit ESM codes if using ESM mode with Babel ([#​2661](https://github.com/kulshekhar/ts-jest/issues/2661)) ([9b55404](https://github.com/kulshekhar/ts-jest/commit/9b55404a8dfc760238e19786da98a2edf043b9da)), closes [#​2650](https://github.com/kulshekhar/ts-jest/issues/2650) #### [27.0.2](https://github.com/kulshekhar/ts-jest/compare/v27.0.1...v27.0.2) (2021-05-30) ##### Bug Fixes - **compiler:** add empty string file content to compiler cache ([#​2633](https://github.com/kulshekhar/ts-jest/issues/2633)) ([0feb556](https://github.com/kulshekhar/ts-jest/commit/0feb5560a588f87d1d989bf521859fba0fda20fe)), closes [#​2625](https://github.com/kulshekhar/ts-jest/issues/2625) - **config:** `exclude` should only exclude files which match glob values ([#​2637](https://github.com/kulshekhar/ts-jest/issues/2637)) ([c5ce979](https://github.com/kulshekhar/ts-jest/commit/c5ce97902c1b84dc354f270a4f596a6f5f634611)), closes [#​2634](https://github.com/kulshekhar/ts-jest/issues/2634) #### [27.0.1](https://github.com/kulshekhar/ts-jest/compare/v27.0.0...v27.0.1) (2021-05-26) ##### Bug Fixes - **cli:** keep `testMatch` if old jest config contains it ([#​2618](https://github.com/kulshekhar/ts-jest/issues/2618)) ([c568f49](https://github.com/kulshekhar/ts-jest/commit/c568f49907fb5559ba1e8c67f1ec5d5eb4af920a)), closes [#​2616](https://github.com/kulshekhar/ts-jest/issues/2616) - **compiler:** make sure `isolatedModules: false` use updated compiler options ([#​2628](https://github.com/kulshekhar/ts-jest/issues/2628)) ([348e30f](https://github.com/kulshekhar/ts-jest/commit/348e30f426803efc51ecba26ab42619938fcb5af)), closes [#​2629](https://github.com/kulshekhar/ts-jest/issues/2629) - add missing export `presets` ([#​2624](https://github.com/kulshekhar/ts-jest/issues/2624)) ([0ea025e](https://github.com/kulshekhar/ts-jest/commit/0ea025ebb456d3a31671e31fac0b401c2734a2b1)), closes [#​2623](https://github.com/kulshekhar/ts-jest/issues/2623) </details> --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/foosbyte/kicker-trainer). Co-authored-by: Renovate Bot <bot@renovateapp.com>
* [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
* 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
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. |
Summary
This PR can close #9534 which was opened as a feature request by @ahnpnl
This PR includes -
mocked
test helpers fromts-jest
https://github.com/kulshekhar/ts-jest/blob/main/src/utils/testing.tstypes from @types/jest https://github.com/DefinitelyTyped/DefinitelyTyped/blob/a68259ee8883cc9899463fe79a78bb49a9d2f6de/types/jest/index.d.ts#L1042-L1298
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.