Skip to content
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

Add caution note to '.' usage in moduleDirectories #14913

Merged
merged 3 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"]`
Expand Down
6 changes: 6 additions & 0 deletions website/versioned_docs/version-29.4/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"]`
Expand Down
6 changes: 6 additions & 0 deletions website/versioned_docs/version-29.5/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"]`
Expand Down
6 changes: 6 additions & 0 deletions website/versioned_docs/version-29.6/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"]`
Expand Down
6 changes: 6 additions & 0 deletions website/versioned_docs/version-29.7/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"]`
Expand Down
Loading