diff --git a/docs/Configuration.md b/docs/Configuration.md index e14fb57dfd74..063c00f136b9 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -938,6 +938,12 @@ const config: Config = { export default config; ``` +:::caution + +It is discouraged to use `'.'` as one of the `moduleDirectories`, because this prevents scoped packages such as `@emotion/react` from accessing packages with the same subdirectory name (`react`). See [this issue](https://github.com/jestjs/jest/issues/10498) for more details. In most cases, it is preferable to use the [moduleNameMapper](#modulenamemapper-objectstring-string--arraystring) configuration instead. + +::: + ### `moduleFileExtensions` \[array<string>] Default: `["js", "mjs", "cjs", "jsx", "ts", "mts", "cts", "tsx", "json", "node"]` diff --git a/website/versioned_docs/version-29.4/Configuration.md b/website/versioned_docs/version-29.4/Configuration.md index 97f0eec0bbfd..b1ffa6a110b0 100644 --- a/website/versioned_docs/version-29.4/Configuration.md +++ b/website/versioned_docs/version-29.4/Configuration.md @@ -929,6 +929,12 @@ const config: Config = { export default config; ``` +:::caution + +It is discouraged to use `'.'` as one of the `moduleDirectories`, because this prevents scoped packages such as `@emotion/react` from accessing packages with the same subdirectory name (`react`). See [this issue](https://github.com/jestjs/jest/issues/10498) for more details. In most cases, it is preferable to use the [moduleNameMapper](#modulenamemapper-objectstring-string--arraystring) configuration instead. + +::: + ### `moduleFileExtensions` \[array<string>] Default: `["js", "mjs", "cjs", "jsx", "ts", "tsx", "json", "node"]` diff --git a/website/versioned_docs/version-29.5/Configuration.md b/website/versioned_docs/version-29.5/Configuration.md index acd25605bfaf..77e9ee87564c 100644 --- a/website/versioned_docs/version-29.5/Configuration.md +++ b/website/versioned_docs/version-29.5/Configuration.md @@ -929,6 +929,12 @@ const config: Config = { export default config; ``` +:::caution + +It is discouraged to use `'.'` as one of the `moduleDirectories`, because this prevents scoped packages such as `@emotion/react` from accessing packages with the same subdirectory name (`react`). See [this issue](https://github.com/jestjs/jest/issues/10498) for more details. In most cases, it is preferable to use the [moduleNameMapper](#modulenamemapper-objectstring-string--arraystring) configuration instead. + +::: + ### `moduleFileExtensions` \[array<string>] Default: `["js", "mjs", "cjs", "jsx", "ts", "tsx", "json", "node"]` diff --git a/website/versioned_docs/version-29.6/Configuration.md b/website/versioned_docs/version-29.6/Configuration.md index 319334091dd7..bd0b75773c5d 100644 --- a/website/versioned_docs/version-29.6/Configuration.md +++ b/website/versioned_docs/version-29.6/Configuration.md @@ -929,6 +929,12 @@ const config: Config = { export default config; ``` +:::caution + +It is discouraged to use `'.'` as one of the `moduleDirectories`, because this prevents scoped packages such as `@emotion/react` from accessing packages with the same subdirectory name (`react`). See [this issue](https://github.com/jestjs/jest/issues/10498) for more details. In most cases, it is preferable to use the [moduleNameMapper](#modulenamemapper-objectstring-string--arraystring) configuration instead. + +::: + ### `moduleFileExtensions` \[array<string>] Default: `["js", "mjs", "cjs", "jsx", "ts", "tsx", "json", "node"]` diff --git a/website/versioned_docs/version-29.7/Configuration.md b/website/versioned_docs/version-29.7/Configuration.md index 319334091dd7..bd0b75773c5d 100644 --- a/website/versioned_docs/version-29.7/Configuration.md +++ b/website/versioned_docs/version-29.7/Configuration.md @@ -929,6 +929,12 @@ const config: Config = { export default config; ``` +:::caution + +It is discouraged to use `'.'` as one of the `moduleDirectories`, because this prevents scoped packages such as `@emotion/react` from accessing packages with the same subdirectory name (`react`). See [this issue](https://github.com/jestjs/jest/issues/10498) for more details. In most cases, it is preferable to use the [moduleNameMapper](#modulenamemapper-objectstring-string--arraystring) configuration instead. + +::: + ### `moduleFileExtensions` \[array<string>] Default: `["js", "mjs", "cjs", "jsx", "ts", "tsx", "json", "node"]`