Skip to content

Commit e2028da

Browse files
authoredJul 31, 2018
Merge branch 'master' into to-dev-deps
2 parents 0b2e406 + 4396dde commit e2028da

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed
 

‎README.md

+21
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,27 @@ If you *have* explicitly set the `module` property but to a different value than
168168

169169
If you use ["baseUrl"](https://www.typescriptlang.org/docs/handbook/module-resolution.html) and "paths" options for the compiler, see ["moduleNameMapper"](https://facebook.github.io/jest/docs/en/configuration.html#modulenamemapper-object-string-string) option on Jest docs.
170170

171+
For example, with the below config in your tsconfig:
172+
```
173+
"paths": {
174+
"@App/*": [
175+
"src/*"
176+
],
177+
"@Shared/*": [
178+
"src/Shared/*"
179+
]
180+
},
181+
```
182+
183+
Here's what your jest config should look like:
184+
185+
```
186+
"moduleNameMapper": {
187+
"@App/(.*)": "<rootDir>/src/$1",
188+
"@Shared/(.*)": "<rootDir>/src/Shared/$1"
189+
}
190+
```
191+
171192
### Skipping Babel
172193
If you don't use mocks, or synthetic default imports you can skip the babel-transpilation step.
173194
This means `jest.mock()` calls will not be hoisted to the top,

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"peerDependencies": {
7171
"babel-core": "^6.26.3 || ^7.0.0-0",
7272
"jest": "^23.0.0 || ^24.0.0",
73-
"typescript": "2.x"
73+
"typescript": "^2.0.0 || ^3.0.0"
7474
},
7575
"devDependencies": {
7676
"@types/babel-core": "latest",

0 commit comments

Comments
 (0)
Please sign in to comment.