Skip to content

Commit

Permalink
add caution note to '.' usage in moduleDirectories
Browse files Browse the repository at this point in the history
resolves #10498
  • Loading branch information
davidroeca committed Feb 21, 2024
1 parent e6d60cb commit 7be4e56
Showing 1 changed file with 6 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

0 comments on commit 7be4e56

Please sign in to comment.