From 264a116fd7e2bed4d3511fc85cf53226e7d9748a Mon Sep 17 00:00:00 2001 From: Artem Zakharchenko Date: Sat, 17 Sep 2022 10:12:25 +0200 Subject: [PATCH] docs: mention `rootDir` changes when using `projects` (#12871) --- docs/Configuration.md | 6 ++++++ website/versioned_docs/version-25.x/Configuration.md | 6 ++++++ website/versioned_docs/version-26.x/Configuration.md | 2 ++ website/versioned_docs/version-27.x/Configuration.md | 2 ++ website/versioned_docs/version-28.x/Configuration.md | 6 ++++++ website/versioned_docs/version-29.0/Configuration.md | 6 ++++++ 6 files changed, 28 insertions(+) diff --git a/docs/Configuration.md b/docs/Configuration.md index debd65b5606c..1f3db639cda5 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -1208,6 +1208,12 @@ When using multi-project runner, it's recommended to add a `displayName` for eac ::: +:::note + +With the `projects` option enabled, Jest will copy the root-level configuration options to each individual child configuration during the test run, resolving its values in the child's context. This means that string tokens like `` will point to the _child's root directory_ even if they are defined in the root-level configuration. + +::: + ### `reporters` \[array<moduleName | \[moduleName, options]>] Default: `undefined` diff --git a/website/versioned_docs/version-25.x/Configuration.md b/website/versioned_docs/version-25.x/Configuration.md index bc5f9580b1e3..1754719485d4 100644 --- a/website/versioned_docs/version-25.x/Configuration.md +++ b/website/versioned_docs/version-25.x/Configuration.md @@ -693,6 +693,12 @@ When using multi-project runner, it's recommended to add a `displayName` for eac ::: +:::note + +With the `projects` option enabled, Jest will copy the root-level configuration options to each individual child configuration during the test run, resolving its values in the child's context. This means that string tokens like `` will point to the _child's root directory_ even if they are defined in the root-level configuration. + +::: + ### `reporters` \[array<moduleName | \[moduleName, options]>] Default: `undefined` diff --git a/website/versioned_docs/version-26.x/Configuration.md b/website/versioned_docs/version-26.x/Configuration.md index 5996d90eb7d8..853807ce6941 100644 --- a/website/versioned_docs/version-26.x/Configuration.md +++ b/website/versioned_docs/version-26.x/Configuration.md @@ -680,6 +680,8 @@ The projects feature can also be used to run multiple configurations or multiple _Note: When using multi-project runner, it's recommended to add a `displayName` for each project. This will show the `displayName` of a project next to its tests._ +_Note: With the `projects` option enabled, Jest will copy the root-level configuration options to each individual child configuration during the test run, resolving its values in the child's context. This means that string tokens like `` will point to the *child's root directory* even if they are defined in the root-level configuration._ + ### `reporters` \[array<moduleName | \[moduleName, options]>] Default: `undefined` diff --git a/website/versioned_docs/version-27.x/Configuration.md b/website/versioned_docs/version-27.x/Configuration.md index 3bfecd8c752c..d60ac477bdba 100644 --- a/website/versioned_docs/version-27.x/Configuration.md +++ b/website/versioned_docs/version-27.x/Configuration.md @@ -707,6 +707,8 @@ The projects feature can also be used to run multiple configurations or multiple _Note: When using multi-project runner, it's recommended to add a `displayName` for each project. This will show the `displayName` of a project next to its tests._ +_Note: With the `projects` option enabled, Jest will copy the root-level configuration options to each individual child configuration during the test run, resolving its values in the child's context. This means that string tokens like `` will point to the *child's root directory* even if they are defined in the root-level configuration._ + ### `reporters` \[array<moduleName | \[moduleName, options]>] Default: `undefined` diff --git a/website/versioned_docs/version-28.x/Configuration.md b/website/versioned_docs/version-28.x/Configuration.md index 1be850550fde..1c6eb3692c34 100644 --- a/website/versioned_docs/version-28.x/Configuration.md +++ b/website/versioned_docs/version-28.x/Configuration.md @@ -844,6 +844,12 @@ When using multi-project runner, it's recommended to add a `displayName` for eac ::: +:::note + +With the `projects` option enabled, Jest will copy the root-level configuration options to each individual child configuration during the test run, resolving its values in the child's context. This means that string tokens like `` will point to the _child's root directory_ even if they are defined in the root-level configuration. + +::: + ### `reporters` \[array<moduleName | \[moduleName, options]>] Default: `undefined` diff --git a/website/versioned_docs/version-29.0/Configuration.md b/website/versioned_docs/version-29.0/Configuration.md index debd65b5606c..1f3db639cda5 100644 --- a/website/versioned_docs/version-29.0/Configuration.md +++ b/website/versioned_docs/version-29.0/Configuration.md @@ -1208,6 +1208,12 @@ When using multi-project runner, it's recommended to add a `displayName` for eac ::: +:::note + +With the `projects` option enabled, Jest will copy the root-level configuration options to each individual child configuration during the test run, resolving its values in the child's context. This means that string tokens like `` will point to the _child's root directory_ even if they are defined in the root-level configuration. + +::: + ### `reporters` \[array<moduleName | \[moduleName, options]>] Default: `undefined`