diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ccaacd976b9..7deada1012c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### Features +- `[jest-config]` Added an option to disable ts-node typechecking ([#15161](https://github.com/jestjs/jest/pull/15161)) - `[jest-circus, jest-cli, jest-config]` Add `waitNextEventLoopTurnForUnhandledRejectionEvents` flag to minimise performance impact of correct detection of unhandled promise rejections introduced in [#14315](https://github.com/jestjs/jest/pull/14315) ([#14681](https://github.com/jestjs/jest/pull/14681)) - `[jest-circus]` Add a `waitBeforeRetry` option to `jest.retryTimes` ([#14738](https://github.com/jestjs/jest/pull/14738)) - `[jest-circus]` Add a `retryImmediately` option to `jest.retryTimes` ([#14696](https://github.com/jestjs/jest/pull/14696)) diff --git a/docs/Configuration.md b/docs/Configuration.md index 063c00f136b9..a3910cb9f6ad 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -58,6 +58,7 @@ export default async (): Promise => { :::tip To read TypeScript configuration files Jest requires [`ts-node`](https://npmjs.com/package/ts-node). Make sure it is installed in your project. +To read configuration files without typechecking, You can set `JEST_CONFIG_TRANSPILE_ONLY` environment variable to `True`. ::: diff --git a/packages/jest-config/src/readConfigFileAndSetRootDir.ts b/packages/jest-config/src/readConfigFileAndSetRootDir.ts index 82abb45b7dee..569899f00be2 100644 --- a/packages/jest-config/src/readConfigFileAndSetRootDir.ts +++ b/packages/jest-config/src/readConfigFileAndSetRootDir.ts @@ -124,7 +124,7 @@ async function registerTsNode(): Promise { moduleTypes: { '**': 'cjs', }, - transpileOnly: process.env.DISABLE_TS_NODE == 'True', + transpileOnly: process.env.JEST_CONFIG_TRANSPILE_ONLY == 'True', }); } catch (error: any) { if (error.code === 'ERR_MODULE_NOT_FOUND') {