Skip to content

Commit

Permalink
docs: Add caution note to '.' usage in moduleDirectories (#14913)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidroeca committed May 29, 2024
1 parent 68dca2a commit 4280a31
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 0 deletions.
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

0 comments on commit 4280a31

Please sign in to comment.