From f192ac55ce33004dba50524814dcf93ef74ea8ed Mon Sep 17 00:00:00 2001 From: Jared M <73684895+professorjrod@users.noreply.github.com> Date: Sun, 9 Oct 2022 22:43:49 -0700 Subject: [PATCH] docs: mention needing additional configuration for `ts-jest` (#13418) --- CHANGELOG.md | 2 +- docs/GettingStarted.md | 2 ++ website/versioned_docs/version-25.x/GettingStarted.md | 2 ++ website/versioned_docs/version-26.x/GettingStarted.md | 2 ++ website/versioned_docs/version-27.x/GettingStarted.md | 2 ++ website/versioned_docs/version-28.x/GettingStarted.md | 2 ++ website/versioned_docs/version-29.0/GettingStarted.md | 2 ++ website/versioned_docs/version-29.1/GettingStarted.md | 2 ++ 8 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e575da0d2e14..76a9f07e2a78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2173,7 +2173,7 @@ We skipped 24.2.0 because a draft was accidentally published. Please use `24.3.0 - `[jest-jasemine2]` Add dependency on jest-each ([#6308](https://github.com/facebook/jest/pull/6308)) - `[jest-each]` Move jest-each into core Jest ([#6278](https://github.com/facebook/jest/pull/6278)) -- `[examples]` Update typescript example to using ts-jest ([#6260](https://github.com/facebook/jest/pull/6260)) +- `[examples]` Update typescript example to using `ts-jest` ([#6260](https://github.com/facebook/jest/pull/6260)) ### Fixes diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index a6b80910b30f..9262cff64b4a 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -162,6 +162,8 @@ However, there are some [caveats](https://babeljs.io/docs/en/babel-plugin-transf npm install --save-dev ts-jest ``` +In order for Jest to transpile TypeScript with `ts-jest`, you may also need to create a [configuration](https://kulshekhar.github.io/ts-jest/docs/getting-started/installation#jest-config-file) file. + #### Type definitions There are two ways to have [Jest global APIs](GlobalAPI.md) typed for test files written in TypeScript. diff --git a/website/versioned_docs/version-25.x/GettingStarted.md b/website/versioned_docs/version-25.x/GettingStarted.md index 83ec792cdfb6..32fba5a31dee 100644 --- a/website/versioned_docs/version-25.x/GettingStarted.md +++ b/website/versioned_docs/version-25.x/GettingStarted.md @@ -166,6 +166,8 @@ However, there are some [caveats](https://babeljs.io/docs/en/babel-plugin-transf yarn add --dev ts-jest ``` +In order for Jest to transpile TypeScript with `ts-jest`, you may also need to create a [configuration](https://kulshekhar.github.io/ts-jest/docs/getting-started/installation#jest-config-file) file. + #### Type definitions You may also want to install the [`@types/jest`](https://www.npmjs.com/package/@types/jest) module for the version of Jest you're using. This will help provide full typing when writing your tests with TypeScript. diff --git a/website/versioned_docs/version-26.x/GettingStarted.md b/website/versioned_docs/version-26.x/GettingStarted.md index 5ae82e854ce5..bfb1287c8c34 100644 --- a/website/versioned_docs/version-26.x/GettingStarted.md +++ b/website/versioned_docs/version-26.x/GettingStarted.md @@ -170,6 +170,8 @@ yarn add --dev ts-jest You may also want to install the [`@types/jest`](https://www.npmjs.com/package/@types/jest) module for the version of Jest you're using. This will help provide full typing when writing your tests with TypeScript. +In order for Jest to transpile TypeScript with `ts-jest`, you may also need to create a [configuration](https://kulshekhar.github.io/ts-jest/docs/getting-started/installation#jest-config-file) file. + :::note For `@types/*` modules it's recommended to try to match the version of the associated module. For example, if you are using `26.4.0` of `jest` then using `26.4.x` of `@types/jest` is ideal. In general, try to match the major (`26`) and minor (`4`) version as closely as possible. diff --git a/website/versioned_docs/version-27.x/GettingStarted.md b/website/versioned_docs/version-27.x/GettingStarted.md index d9d82caecae7..5dc9af2cd93b 100644 --- a/website/versioned_docs/version-27.x/GettingStarted.md +++ b/website/versioned_docs/version-27.x/GettingStarted.md @@ -168,6 +168,8 @@ yarn add --dev ts-jest You may also want to install the [`@types/jest`](https://www.npmjs.com/package/@types/jest) module for the version of Jest you're using. This will help provide full typing when writing your tests with TypeScript. +In order for Jest to transpile TypeScript with `ts-jest`, you may also need to create a [configuration](https://kulshekhar.github.io/ts-jest/docs/getting-started/installation#jest-config-file) file. + :::note For `@types/*` modules it's recommended to try to match the version of the associated module. For example, if you are using `26.4.0` of `jest` then using `26.4.x` of `@types/jest` is ideal. In general, try to match the major (`26`) and minor (`4`) version as closely as possible. diff --git a/website/versioned_docs/version-28.x/GettingStarted.md b/website/versioned_docs/version-28.x/GettingStarted.md index 3440c221aabb..5772f736c5a0 100644 --- a/website/versioned_docs/version-28.x/GettingStarted.md +++ b/website/versioned_docs/version-28.x/GettingStarted.md @@ -158,6 +158,8 @@ However, there are some [caveats](https://babeljs.io/docs/en/babel-plugin-transf npm install --save-dev ts-jest ``` +In order for Jest to transpile TypeScript with `ts-jest`, you may also need to create a [configuration](https://kulshekhar.github.io/ts-jest/docs/getting-started/installation#jest-config-file) file. + #### Type definitions You may also want to install the [`@types/jest`](https://www.npmjs.com/package/@types/jest) module for the version of Jest you're using. This will help provide full typing when writing your tests with TypeScript. diff --git a/website/versioned_docs/version-29.0/GettingStarted.md b/website/versioned_docs/version-29.0/GettingStarted.md index 6487633f3410..e4f9b4d1bb26 100644 --- a/website/versioned_docs/version-29.0/GettingStarted.md +++ b/website/versioned_docs/version-29.0/GettingStarted.md @@ -158,6 +158,8 @@ However, there are some [caveats](https://babeljs.io/docs/en/babel-plugin-transf npm install --save-dev ts-jest ``` +In order for Jest to transpile TypeScript with `ts-jest`, you may also need to create a [configuration](https://kulshekhar.github.io/ts-jest/docs/getting-started/installation#jest-config-file) file. + #### Type definitions There are two ways to have [Jest global APIs](GlobalAPI.md) typed for test files written in TypeScript. diff --git a/website/versioned_docs/version-29.1/GettingStarted.md b/website/versioned_docs/version-29.1/GettingStarted.md index a6b80910b30f..9262cff64b4a 100644 --- a/website/versioned_docs/version-29.1/GettingStarted.md +++ b/website/versioned_docs/version-29.1/GettingStarted.md @@ -162,6 +162,8 @@ However, there are some [caveats](https://babeljs.io/docs/en/babel-plugin-transf npm install --save-dev ts-jest ``` +In order for Jest to transpile TypeScript with `ts-jest`, you may also need to create a [configuration](https://kulshekhar.github.io/ts-jest/docs/getting-started/installation#jest-config-file) file. + #### Type definitions There are two ways to have [Jest global APIs](GlobalAPI.md) typed for test files written in TypeScript.