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: use correct typings for config:init command #3825

Merged
merged 1 commit into from Sep 22, 2022

Conversation

connorjburton
Copy link
Contributor

Summary

The config:init command would generate the config with the incorrect typings. This documentation page shows what the typings should be.

Test plan

I did not see any tests for the config command. There probably should be some but I am not sure this PR is the appropriate place to write tests for the config command(s).

This particular change could be tested, but writing a test to make sure the string is what I changed it to is not really a test, I am not familiar enough with ts-jest to suggest a better approach to test this.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@mrazauskas
Copy link
Contributor

Nice and quick!

Isn’t it that the script still creates outdated config with globals instead of transform key? Or am I misreading?

@ahnpnl
Copy link
Collaborator

ahnpnl commented Sep 22, 2022

You are right that it is still generating the deprecated config. Candidate for another PR:)

@connorjburton
Copy link
Contributor Author

connorjburton commented Sep 22, 2022

Turns out there are tests, I did not look hard enough.

Going to address the tests and the other deprecated config

@ahnpnl
Copy link
Collaborator

ahnpnl commented Sep 22, 2022

Turns out there are tests, I did not look hard enough.

Going to address the tests and the other deprecated config

I already pushed:)

@connorjburton
Copy link
Contributor Author

Thank you @ahnpnl! Do you want me to create a different PR for updating the deprecated config?

@coveralls
Copy link

Pull Request Test Coverage Report for Build 3107636585

  • 0 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.3%) to 96.353%

Totals Coverage Status
Change from base Build 3089488315: 0.3%
Covered Lines: 3993
Relevant Lines: 4090

💛 - Coveralls

@coveralls
Copy link

Pull Request Test Coverage Report for Build 3107636585

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.3%) to 96.353%

Totals Coverage Status
Change from base Build 3089488315: 0.3%
Covered Lines: 3993
Relevant Lines: 4090

💛 - Coveralls

@ahnpnl
Copy link
Collaborator

ahnpnl commented Sep 22, 2022

Thank you @ahnpnl! Do you want me to create a different PR for updating the deprecated config?

Yes feel free to do so:)

@ahnpnl ahnpnl merged commit 21b94db into kulshekhar:main Sep 22, 2022
17 checks passed
Vylpes pushed a commit to Vylpes/vylbot-app that referenced this pull request May 15, 2023
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [ts-jest](https://kulshekhar.github.io/ts-jest) ([source](https://github.com/kulshekhar/ts-jest)) | dependencies | major | [`^27.1.2` -> `^29.0.0`](https://renovatebot.com/diffs/npm/ts-jest/27.1.5/29.1.0) |

---

### Release Notes

<details>
<summary>kulshekhar/ts-jest</summary>

### [`v29.1.0`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#&#8203;2910-httpsgithubcomkulshekharts-jestcomparev2905v2910-2023-03-26)

[Compare Source](kulshekhar/ts-jest@v29.0.5...v29.1.0)

##### Features

-   Support TypeScript 5.x ([#&#8203;4064](kulshekhar/ts-jest#4064)) ([db98cc9](kulshekhar/ts-jest@87f2782)), closes [#&#8203;4048](kulshekhar/ts-jest#4048)

#### [29.0.5](kulshekhar/ts-jest@v29.0.4...v29.0.5) (2023-01-13)

##### Reverts

-   Revert "fix(transformer): don't use cache when `tsJestConfig` is different ([#&#8203;3966](kulshekhar/ts-jest#3966))" ([185eb18](kulshekhar/ts-jest@185eb18)), closes [#&#8203;3966](kulshekhar/ts-jest#3966)

#### [29.0.4](kulshekhar/ts-jest@v29.0.3...v29.0.4) (2023-01-10)

##### Bug Fixes

-   **transformer:** don't use cache when `tsJestConfig` is different ([#&#8203;3966](kulshekhar/ts-jest#3966)) ([a445638](kulshekhar/ts-jest@a445638))
-   bump `json5` to `2.2.3` ([#&#8203;3976](kulshekhar/ts-jest#3976))

#### [29.0.3](kulshekhar/ts-jest@v29.0.2...v29.0.3) (2022-09-28)

##### Bug Fixes

-   merge config from `globals` with transformer config correctly ([#&#8203;3842](kulshekhar/ts-jest#3842)) ([9c9fd60](kulshekhar/ts-jest@9c9fd60)), closes [#&#8203;3841](kulshekhar/ts-jest#3841)
-   **presets:** allow merging transform config when using presets ([#&#8203;3833](kulshekhar/ts-jest#3833)) ([afc6a94](kulshekhar/ts-jest@afc6a94))

##### Features

-   add `useESM` option to `pathsToModuleNameMapper` options ([#&#8203;3792](kulshekhar/ts-jest#3792)) ([eabe906](kulshekhar/ts-jest@eabe906))

#### [29.0.2](kulshekhar/ts-jest@v29.0.1...v29.0.2) (2022-09-23)

##### Bug Fixes

-   mark `ts-jest` as optional in `ConfigGlobals` ([#&#8203;3816](kulshekhar/ts-jest#3816)) ([cbb88bb](kulshekhar/ts-jest@cbb88bb)), closes [#&#8203;3815](kulshekhar/ts-jest#3815)
-   use correct typings for `config:init` command ([#&#8203;3825](kulshekhar/ts-jest#3825)) ([21b94db](kulshekhar/ts-jest@21b94db))

#### [29.0.2](kulshekhar/ts-jest@v29.0.1...v29.0.2) (2022-09-22)

##### Bug Fixes

-   mark `ts-jest` as optional in `ConfigGlobals` ([#&#8203;3816](kulshekhar/ts-jest#3816)) ([cbb88bb](kulshekhar/ts-jest@cbb88bb)), closes [#&#8203;3815](kulshekhar/ts-jest#3815)

#### [29.0.1](kulshekhar/ts-jest@v29.0.0...v29.0.1) (2022-09-13)

##### Bug Fixes

-   **legacy:** include existing globals config in cached config ([#&#8203;3803](kulshekhar/ts-jest#3803)) ([e79be47](kulshekhar/ts-jest@e79be47))

##### Features

-   add typings for `ts-jest` options via `transform` config ([#&#8203;3805](kulshekhar/ts-jest#3805)) ([664b0f2](kulshekhar/ts-jest@664b0f2))

### [`v29.0.5`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#&#8203;2905-httpsgithubcomkulshekharts-jestcomparev2904v2905-2023-01-13)

[Compare Source](kulshekhar/ts-jest@v29.0.4...v29.0.5)

##### Reverts

-   Revert "fix(transformer): don't use cache when `tsJestConfig` is different ([#&#8203;3966](kulshekhar/ts-jest#3966))" ([185eb18](kulshekhar/ts-jest@185eb18)), closes [#&#8203;3966](kulshekhar/ts-jest#3966)

### [`v29.0.4`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#&#8203;2904-httpsgithubcomkulshekharts-jestcomparev2903v2904-2023-01-10)

[Compare Source](kulshekhar/ts-jest@v29.0.3...v29.0.4)

##### Bug Fixes

-   **transformer:** don't use cache when `tsJestConfig` is different ([#&#8203;3966](kulshekhar/ts-jest#3966)) ([a445638](kulshekhar/ts-jest@a445638))
-   bump `json5` to `2.2.3` ([#&#8203;3976](kulshekhar/ts-jest#3976))

### [`v29.0.3`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#&#8203;2903-httpsgithubcomkulshekharts-jestcomparev2902v2903-2022-09-28)

[Compare Source](kulshekhar/ts-jest@v29.0.2...v29.0.3)

##### Bug Fixes

-   merge config from `globals` with transformer config correctly ([#&#8203;3842](kulshekhar/ts-jest#3842)) ([9c9fd60](kulshekhar/ts-jest@9c9fd60)), closes [#&#8203;3841](kulshekhar/ts-jest#3841)
-   **presets:** allow merging transform config when using presets ([#&#8203;3833](kulshekhar/ts-jest#3833)) ([afc6a94](kulshekhar/ts-jest@afc6a94))

##### Features

-   add `useESM` option to `pathsToModuleNameMapper` options ([#&#8203;3792](kulshekhar/ts-jest#3792)) ([eabe906](kulshekhar/ts-jest@eabe906))

### [`v29.0.2`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#&#8203;2902-httpsgithubcomkulshekharts-jestcomparev2901v2902-2022-09-23)

[Compare Source](kulshekhar/ts-jest@v29.0.1...v29.0.2)

##### Bug Fixes

-   mark `ts-jest` as optional in `ConfigGlobals` ([#&#8203;3816](kulshekhar/ts-jest#3816)) ([cbb88bb](kulshekhar/ts-jest@cbb88bb)), closes [#&#8203;3815](kulshekhar/ts-jest#3815)
-   use correct typings for `config:init` command ([#&#8203;3825](kulshekhar/ts-jest#3825)) ([21b94db](kulshekhar/ts-jest@21b94db))

### [`v29.0.1`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#&#8203;2901-httpsgithubcomkulshekharts-jestcomparev2900v2901-2022-09-13)

[Compare Source](kulshekhar/ts-jest@v29.0.0...v29.0.1)

##### Bug Fixes

-   **legacy:** include existing globals config in cached config ([#&#8203;3803](kulshekhar/ts-jest#3803)) ([e79be47](kulshekhar/ts-jest@e79be47))

##### Features

-   add typings for `ts-jest` options via `transform` config ([#&#8203;3805](kulshekhar/ts-jest#3805)) ([664b0f2](kulshekhar/ts-jest@664b0f2))

### [`v29.0.0`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#&#8203;2900-httpsgithubcomkulshekharts-jestcomparev2900-next1v2900-2022-09-08)

[Compare Source](kulshekhar/ts-jest@v28.0.8...v29.0.0)

##### Features

-   drop Node 12 and Node 17 support ([#&#8203;3787](kulshekhar/ts-jest#3787)) ([0f1de16](kulshekhar/ts-jest@0f1de16))
-   migrate globals config to transformer config ([#&#8203;3780](kulshekhar/ts-jest#3780)) ([31e5843](kulshekhar/ts-jest@31e5843))
-   support Jest 29 ([#&#8203;3767](kulshekhar/ts-jest#3767)) ([94b553b](kulshekhar/ts-jest@94b553b))

##### DEPRECATIONS

-   Define `ts-jest` config under `globals` is now deprecated. Please define the config via transformer config instead.

##### BREAKING CHANGES

-   Only Node 14, 16 and 18 are supported
-   **Jest 29** is required.

### [`v28.0.8`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#&#8203;2808-httpsgithubcomkulshekharts-jestcomparev2807v2808-2022-08-14)

[Compare Source](kulshekhar/ts-jest@v28.0.7...v28.0.8)

##### Bug Fixes

-   allow `.mts` to be processed ([#&#8203;3713](kulshekhar/ts-jest#3713)) ([effae71](kulshekhar/ts-jest@effae71)), closes [#&#8203;3702](kulshekhar/ts-jest#3702)

### [`v28.0.7`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#&#8203;2807-httpsgithubcomkulshekharts-jestcomparev2806v2807-2022-07-15)

[Compare Source](kulshekhar/ts-jest@v28.0.6...v28.0.7)

##### Bug Fixes

-   update `@jest/types` to be an optional peer dependency ([#&#8203;3690](kulshekhar/ts-jest#3690)) ([8a8c3fa](kulshekhar/ts-jest@8a8c3fa)), closes [#&#8203;3689](kulshekhar/ts-jest#3689)

### [`v28.0.6`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#&#8203;2806-httpsgithubcomkulshekharts-jestcomparev2805v2806-2022-07-13)

[Compare Source](kulshekhar/ts-jest@v28.0.5...v28.0.6)

##### Bug Fixes

-   **config:** don't show diagnostics warning with `diagnostics: false` ([#&#8203;3647](kulshekhar/ts-jest#3647)) ([9a9bc02](kulshekhar/ts-jest@9a9bc02)), closes [#&#8203;3638](kulshekhar/ts-jest#3638)
-   **legacy:** add `useCaseSensitiveFileNames` wherever needed ([#&#8203;3683](kulshekhar/ts-jest#3683)) ([c40bc34](kulshekhar/ts-jest@c40bc34)), closes [#&#8203;3665](kulshekhar/ts-jest#3665)
-   set `@jest/types` as peer dependency ([#&#8203;3633](kulshekhar/ts-jest#3633)) ([24567e1](kulshekhar/ts-jest@24567e1))

### [`v28.0.5`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#&#8203;2805-httpsgithubcomkulshekharts-jestcomparev2804v2805-2022-06-11)

[Compare Source](kulshekhar/ts-jest@v28.0.4...v28.0.5)

##### Bug Fixes

-   **legacy:** throw type check error in ESM mode with `reject` ([#&#8203;3618](kulshekhar/ts-jest#3618)) ([7dd01ff](kulshekhar/ts-jest@7dd01ff)), closes [#&#8203;3507](kulshekhar/ts-jest#3507)

### [`v28.0.4`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#&#8203;2804-httpsgithubcomkulshekharts-jestcomparev2803v2804-2022-06-02)

[Compare Source](kulshekhar/ts-jest@v28.0.3...v28.0.4)

##### Bug Fixes

-   remove `@types/jest` from peer deps ([#&#8203;3592](kulshekhar/ts-jest#3592)) ([b66b656](kulshekhar/ts-jest@b66b656))

### [`v28.0.3`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#&#8203;2803-httpsgithubcomkulshekharts-jestcomparev2802v2803-2022-05-23)

[Compare Source](kulshekhar/ts-jest@v28.0.2...v28.0.3)

##### Bug Fixes

-   **security:** update version of `json5` ([#&#8203;3528](kulshekhar/ts-jest#3528)) ([b31f5ba](kulshekhar/ts-jest@b31f5ba))

### [`v28.0.2`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#&#8203;2802-httpsgithubcomkulshekharts-jestcomparev2801v2802-2022-05-07)

[Compare Source](kulshekhar/ts-jest@v28.0.1...v28.0.2)

##### Bug Fixes

-   **transformers:** use `Array.sort` in hoisting transformer ([#&#8203;3498](kulshekhar/ts-jest#3498)) ([e400a6e](kulshekhar/ts-jest@e400a6e)), closes [#&#8203;3476](kulshekhar/ts-jest#3476)

### [`v28.0.1`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#&#8203;2801-httpsgithubcomkulshekharts-jestcomparev2800v2801-2022-05-03)

[Compare Source](kulshekhar/ts-jest@v28.0.0...v28.0.1)

##### Bug Fixes

-   lower the required node version to ^16.10 ([#&#8203;3495](kulshekhar/ts-jest#3495)) ([3a4e48a](kulshekhar/ts-jest@3a4e48a)), closes [#&#8203;3494](kulshekhar/ts-jest#3494)

### [`v28.0.0`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#&#8203;2800-httpsgithubcomkulshekharts-jestcomparev2800-next3v2800-2022-05-02)

[Compare Source](kulshekhar/ts-jest@v27.1.5...v28.0.0)

##### Bug Fixes

-   **legacy** invoke Babel `processAsync` for `babel-jest` in ESM mode instead of `process` ([#&#8203;3430](kulshekhar/ts-jest#3430)) ([0d7356c](kulshekhar/ts-jest@0d7356c))

##### Features

-   **presets:** add presets for legacy mode ([#&#8203;3465](kulshekhar/ts-jest#3465)) ([543b4ad](kulshekhar/ts-jest@543b4ad))
-   mark `ConfigSet` as legacy ([#&#8203;3456](kulshekhar/ts-jest#3456)) ([a986729](kulshekhar/ts-jest@a986729))
-   mark `TsCompiler` and `TsJestCompiler` as legacy ([#&#8203;3457](kulshekhar/ts-jest#3457)) ([0f2fe30](kulshekhar/ts-jest@0f2fe30))
-   remove `path-mapping` AST transformer ([#&#8203;3455](kulshekhar/ts-jest#3455)) ([f566869](kulshekhar/ts-jest@f566869))
-   set Jest peer dependencies to v28 ([#&#8203;3454](kulshekhar/ts-jest#3454)) ([1e880ff](kulshekhar/ts-jest@1e880ff))
-   **core:** drop support for Node.js 10 ([#&#8203;3332](kulshekhar/ts-jest#3332)) ([7a9aa61](kulshekhar/ts-jest@7a9aa61))
-   **core:** remove `mocked` testing util ([#&#8203;3333](kulshekhar/ts-jest#3333)) ([2d9017d](kulshekhar/ts-jest@2d9017d))
-   **core:** remove `ts-jest/utils` sub path export ([#&#8203;3334](kulshekhar/ts-jest#3334)) ([9f253d3](kulshekhar/ts-jest@9f253d3))
-   mark `TsJestTransformer` as legacy ([#&#8203;3451](kulshekhar/ts-jest#3451)) ([b090179](kulshekhar/ts-jest@b090179))

##### BREAKING CHANGES

-   `path-mapping` AST transformer is no longer shipped in `ts-jest` v28. Please use an alternative one like https://github.com/LeDDGroup/typescript-transform-paths instead.
-   Any imports `ts-jest/dist/compiler/ts-compiler` should change to `ts-jest/dist/legacy/compiler/ts-compiler`
-   Any imports `ts-jest/dist/compiler/ts-jest-compiler` should change to `ts-jest/dist/legacy/compiler/ts-jest-compiler`
-   Any imports `ts-jest/dist/config/config-set` should change to `ts-jest/dist/legacy/config/config-set`
-   Minimum support `TypeScript` version is now **4.3** since Jest 28 requires it.
-   **Jest 28** is required.
-   **core:** Any imports `ts-jest/utils` should be replaced with `ts-jest`.
-   **core:** Starting from Jest 27.4, `mocked` has been integrated into Jest repo.
-   **core:** Support for Node.js v10 has been removed as Jest drops support for it.

#### [27.1.5](kulshekhar/ts-jest@v27.1.3...v27.1.4) (2022-05-17)

##### Bug Fixes

-   **transformers** use `Array.sort` in hoisting transformer ([#&#8203;3498](kulshekhar/ts-jest#3498)) ([e400a6e](kulshekhar/ts-jest@e400a6e)), fixes [#&#8203;3476](kulshekhar/ts-jest#3476)

#### [27.1.4](kulshekhar/ts-jest@v27.1.3...v27.1.4) (2022-03-24)

##### Bug Fixes

-   **compiler:** revert [#&#8203;3194](kulshekhar/ts-jest#3194) ([#&#8203;3362](kulshekhar/ts-jest#3362)) ([2b7dffe](kulshekhar/ts-jest@2b7dffe)), closes [#&#8203;3272](kulshekhar/ts-jest#3272)
-   remove `esbuild` from peer dependency ([#&#8203;3360](kulshekhar/ts-jest#3360)) ([8c8c1ca](kulshekhar/ts-jest@8c8c1ca)), closes [#&#8203;3346](kulshekhar/ts-jest#3346)
-   support Babel config file with `.cjs` extension ([#&#8203;3361](kulshekhar/ts-jest#3361)) ([5e5ac4a](kulshekhar/ts-jest@5e5ac4a)), closes [#&#8203;3335](kulshekhar/ts-jest#3335)

#### [27.1.3](kulshekhar/ts-jest@v27.1.2...v27.1.3) (2022-01-14)

##### Bug Fixes

-   **compiler:** update memory cache for compiler using received file content ([#&#8203;3194](kulshekhar/ts-jest#3194)) ([e4d9541](kulshekhar/ts-jest@e4d9541))

#### [27.1.2](kulshekhar/ts-jest@v27.1.1...v27.1.2) (2021-12-15)

##### Bug Fixes

-   stimulate `esbuild` type to avoid importing `esbuild` directly ([#&#8203;3147](kulshekhar/ts-jest#3147)) ([9ace0a9](kulshekhar/ts-jest@9ace0a9))

#### [27.1.1](kulshekhar/ts-jest@v27.1.0...v27.1.1) (2021-12-07)

##### Bug Fixes

-   bring back `afterProcess` hook ([#&#8203;3132](kulshekhar/ts-jest#3132)) ([2b6b86e](kulshekhar/ts-jest@2b6b86e))
-   make `esbuild` as optional peer dependency ([#&#8203;3129](kulshekhar/ts-jest#3129)) ([20258de](kulshekhar/ts-jest@20258de))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

 **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, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC43NC4yIiwidXBkYXRlZEluVmVyIjoiMzQuNzQuMiJ9-->

Co-authored-by: Renovate Bot <renovate@vylpes.com>
Reviewed-on: https://gitea.vylpes.xyz/RabbitLabs/vylbot-app/pulls/244
Co-authored-by: RenovateBot <renovate@vylpes.com>
Co-committed-by: RenovateBot <renovate@vylpes.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants