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
[Bug]: v29 regression for specifying a tsconfig
#3841
Comments
@ahnpnl thanks for the quick turnaround, look forward to trying it out! |
I am still getting a bug related to this issue in the newest version v29.0.3 with the patch. With the transform: {
"^.+\.m?[tj]sx?$": [
'ts-jest',
{
tsconfig: 'tsconfig.test.json',
},
],
}, |
Remove |
Indeed it did, thank you @ahnpnl. |
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#​2910-httpsgithubcomkulshekharts-jestcomparev2905v2910-2023-03-26) [Compare Source](kulshekhar/ts-jest@v29.0.5...v29.1.0) ##### Features - Support TypeScript 5.x ([#​4064](kulshekhar/ts-jest#4064)) ([db98cc9](kulshekhar/ts-jest@87f2782)), closes [#​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 ([#​3966](kulshekhar/ts-jest#3966))" ([185eb18](kulshekhar/ts-jest@185eb18)), closes [#​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 ([#​3966](kulshekhar/ts-jest#3966)) ([a445638](kulshekhar/ts-jest@a445638)) - bump `json5` to `2.2.3` ([#​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 ([#​3842](kulshekhar/ts-jest#3842)) ([9c9fd60](kulshekhar/ts-jest@9c9fd60)), closes [#​3841](kulshekhar/ts-jest#3841) - **presets:** allow merging transform config when using presets ([#​3833](kulshekhar/ts-jest#3833)) ([afc6a94](kulshekhar/ts-jest@afc6a94)) ##### Features - add `useESM` option to `pathsToModuleNameMapper` options ([#​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` ([#​3816](kulshekhar/ts-jest#3816)) ([cbb88bb](kulshekhar/ts-jest@cbb88bb)), closes [#​3815](kulshekhar/ts-jest#3815) - use correct typings for `config:init` command ([#​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` ([#​3816](kulshekhar/ts-jest#3816)) ([cbb88bb](kulshekhar/ts-jest@cbb88bb)), closes [#​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 ([#​3803](kulshekhar/ts-jest#3803)) ([e79be47](kulshekhar/ts-jest@e79be47)) ##### Features - add typings for `ts-jest` options via `transform` config ([#​3805](kulshekhar/ts-jest#3805)) ([664b0f2](kulshekhar/ts-jest@664b0f2)) ### [`v29.0.5`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#​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 ([#​3966](kulshekhar/ts-jest#3966))" ([185eb18](kulshekhar/ts-jest@185eb18)), closes [#​3966](kulshekhar/ts-jest#3966) ### [`v29.0.4`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#​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 ([#​3966](kulshekhar/ts-jest#3966)) ([a445638](kulshekhar/ts-jest@a445638)) - bump `json5` to `2.2.3` ([#​3976](kulshekhar/ts-jest#3976)) ### [`v29.0.3`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#​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 ([#​3842](kulshekhar/ts-jest#3842)) ([9c9fd60](kulshekhar/ts-jest@9c9fd60)), closes [#​3841](kulshekhar/ts-jest#3841) - **presets:** allow merging transform config when using presets ([#​3833](kulshekhar/ts-jest#3833)) ([afc6a94](kulshekhar/ts-jest@afc6a94)) ##### Features - add `useESM` option to `pathsToModuleNameMapper` options ([#​3792](kulshekhar/ts-jest#3792)) ([eabe906](kulshekhar/ts-jest@eabe906)) ### [`v29.0.2`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#​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` ([#​3816](kulshekhar/ts-jest#3816)) ([cbb88bb](kulshekhar/ts-jest@cbb88bb)), closes [#​3815](kulshekhar/ts-jest#3815) - use correct typings for `config:init` command ([#​3825](kulshekhar/ts-jest#3825)) ([21b94db](kulshekhar/ts-jest@21b94db)) ### [`v29.0.1`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#​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 ([#​3803](kulshekhar/ts-jest#3803)) ([e79be47](kulshekhar/ts-jest@e79be47)) ##### Features - add typings for `ts-jest` options via `transform` config ([#​3805](kulshekhar/ts-jest#3805)) ([664b0f2](kulshekhar/ts-jest@664b0f2)) ### [`v29.0.0`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#​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 ([#​3787](kulshekhar/ts-jest#3787)) ([0f1de16](kulshekhar/ts-jest@0f1de16)) - migrate globals config to transformer config ([#​3780](kulshekhar/ts-jest#3780)) ([31e5843](kulshekhar/ts-jest@31e5843)) - support Jest 29 ([#​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#​2808-httpsgithubcomkulshekharts-jestcomparev2807v2808-2022-08-14) [Compare Source](kulshekhar/ts-jest@v28.0.7...v28.0.8) ##### Bug Fixes - allow `.mts` to be processed ([#​3713](kulshekhar/ts-jest#3713)) ([effae71](kulshekhar/ts-jest@effae71)), closes [#​3702](kulshekhar/ts-jest#3702) ### [`v28.0.7`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#​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 ([#​3690](kulshekhar/ts-jest#3690)) ([8a8c3fa](kulshekhar/ts-jest@8a8c3fa)), closes [#​3689](kulshekhar/ts-jest#3689) ### [`v28.0.6`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#​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` ([#​3647](kulshekhar/ts-jest#3647)) ([9a9bc02](kulshekhar/ts-jest@9a9bc02)), closes [#​3638](kulshekhar/ts-jest#3638) - **legacy:** add `useCaseSensitiveFileNames` wherever needed ([#​3683](kulshekhar/ts-jest#3683)) ([c40bc34](kulshekhar/ts-jest@c40bc34)), closes [#​3665](kulshekhar/ts-jest#3665) - set `@jest/types` as peer dependency ([#​3633](kulshekhar/ts-jest#3633)) ([24567e1](kulshekhar/ts-jest@24567e1)) ### [`v28.0.5`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#​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` ([#​3618](kulshekhar/ts-jest#3618)) ([7dd01ff](kulshekhar/ts-jest@7dd01ff)), closes [#​3507](kulshekhar/ts-jest#3507) ### [`v28.0.4`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#​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 ([#​3592](kulshekhar/ts-jest#3592)) ([b66b656](kulshekhar/ts-jest@b66b656)) ### [`v28.0.3`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#​2803-httpsgithubcomkulshekharts-jestcomparev2802v2803-2022-05-23) [Compare Source](kulshekhar/ts-jest@v28.0.2...v28.0.3) ##### Bug Fixes - **security:** update version of `json5` ([#​3528](kulshekhar/ts-jest#3528)) ([b31f5ba](kulshekhar/ts-jest@b31f5ba)) ### [`v28.0.2`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#​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 ([#​3498](kulshekhar/ts-jest#3498)) ([e400a6e](kulshekhar/ts-jest@e400a6e)), closes [#​3476](kulshekhar/ts-jest#3476) ### [`v28.0.1`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#​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 ([#​3495](kulshekhar/ts-jest#3495)) ([3a4e48a](kulshekhar/ts-jest@3a4e48a)), closes [#​3494](kulshekhar/ts-jest#3494) ### [`v28.0.0`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#​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` ([#​3430](kulshekhar/ts-jest#3430)) ([0d7356c](kulshekhar/ts-jest@0d7356c)) ##### Features - **presets:** add presets for legacy mode ([#​3465](kulshekhar/ts-jest#3465)) ([543b4ad](kulshekhar/ts-jest@543b4ad)) - mark `ConfigSet` as legacy ([#​3456](kulshekhar/ts-jest#3456)) ([a986729](kulshekhar/ts-jest@a986729)) - mark `TsCompiler` and `TsJestCompiler` as legacy ([#​3457](kulshekhar/ts-jest#3457)) ([0f2fe30](kulshekhar/ts-jest@0f2fe30)) - remove `path-mapping` AST transformer ([#​3455](kulshekhar/ts-jest#3455)) ([f566869](kulshekhar/ts-jest@f566869)) - set Jest peer dependencies to v28 ([#​3454](kulshekhar/ts-jest#3454)) ([1e880ff](kulshekhar/ts-jest@1e880ff)) - **core:** drop support for Node.js 10 ([#​3332](kulshekhar/ts-jest#3332)) ([7a9aa61](kulshekhar/ts-jest@7a9aa61)) - **core:** remove `mocked` testing util ([#​3333](kulshekhar/ts-jest#3333)) ([2d9017d](kulshekhar/ts-jest@2d9017d)) - **core:** remove `ts-jest/utils` sub path export ([#​3334](kulshekhar/ts-jest#3334)) ([9f253d3](kulshekhar/ts-jest@9f253d3)) - mark `TsJestTransformer` as legacy ([#​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 ([#​3498](kulshekhar/ts-jest#3498)) ([e400a6e](kulshekhar/ts-jest@e400a6e)), fixes [#​3476](kulshekhar/ts-jest#3476) #### [27.1.4](kulshekhar/ts-jest@v27.1.3...v27.1.4) (2022-03-24) ##### Bug Fixes - **compiler:** revert [#​3194](kulshekhar/ts-jest#3194) ([#​3362](kulshekhar/ts-jest#3362)) ([2b7dffe](kulshekhar/ts-jest@2b7dffe)), closes [#​3272](kulshekhar/ts-jest#3272) - remove `esbuild` from peer dependency ([#​3360](kulshekhar/ts-jest#3360)) ([8c8c1ca](kulshekhar/ts-jest@8c8c1ca)), closes [#​3346](kulshekhar/ts-jest#3346) - support Babel config file with `.cjs` extension ([#​3361](kulshekhar/ts-jest#3361)) ([5e5ac4a](kulshekhar/ts-jest@5e5ac4a)), closes [#​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 ([#​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 ([#​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 ([#​3132](kulshekhar/ts-jest#3132)) ([2b6b86e](kulshekhar/ts-jest@2b6b86e)) - make `esbuild` as optional peer dependency ([#​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>
Version
v29.x
Steps to reproduce
Baseline, v28
git clone git@github.com:apollo-server-integrations/apollo-server-integration-aws-lambda.git
npm i && npm t
Errors after upgrading to v29
git checkout trevor/jest-v29
npm i && npm t
Expand for error output
ts-jest[ts-jest-transformer] (WARN) Define
ts-jest
config underglobals
is deprecated. Please dotransform: {
<transform_regex>: ['ts-jest', { /* ts-jest config goes here in Jest */ }],
},
ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting
esModuleInterop
totrue
in your TypeScript configuration file (usuallytsconfig.json
). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.src/index.ts:78:21 - error TS2550: Property 'fromEntries' does not exist on type 'ObjectConstructor'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2019' or later.
78 ...Object.fromEntries(headers),
~~~~~~~~~~~
Expected behavior
I expect
ts-jest
to resolve and use thetsconfig
that is specified in my Jest config.Actual behavior
ts-jest
does not resolve my specifiedtsconfig
, but instead resolves the defaulttsconfig.json
at the root of the project.Debug log
Available on request (or can be generated through the reproduction). It is too long to submit the issue.
Additional context
Problem
The errors are a bit cryptic, but I've deduced that
ts-jest
is no longer resolving the specifiedtsconfig
file in the jest config (below). It is instead always falling back to the defaulttsconfig.json
.I've also tried updating to the
transform
configuration format with the same result.Confirmation steps
mv tsconfig.json _tsconfig.json
mv tsconfig.test.json tsconfig.json
npm t
Jest config
Environment
The text was updated successfully, but these errors were encountered: