Skip to content

Commit 105c25e

Browse files
emilebercpojer
authored andcommitted
Add moduleNameMapper ordering note to the documentation (#5249)
* Add moduleNameMapper ordering note to the documentation * Add changelog entry
1 parent 38aec14 commit 105c25e

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141
* `[docs]` Describe the order of execution of describe and test blocks.
4242
([#5217](https://github.com/facebook/jest/pull/5217), [#5238](https://github.com/facebook/jest/pull/5238))
43+
* `[docs]` Add a note on `moduleNameMapper` ordering. ([#5249](https://github.com/facebook/jest/pull/5249))
4344

4445
## jest 22.0.4
4546

docs/Configuration.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,9 @@ Example:
386386
}
387387
```
388388

389+
The order in which the mappings are defined matters. Patterns are checked one
390+
by one until one fits. The most specific rule should be listed first.
391+
389392
_Note: If you provide module name without boundaries `^$` it may cause hard to
390393
spot errors. E.g. `relay` will replace all modules which contain `relay` as a
391394
substring in its name: `relay`, `react-relay` and `graphql-relay` will all be

0 commit comments

Comments
 (0)