You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+21
Original file line number
Diff line number
Diff line change
@@ -168,6 +168,27 @@ If you *have* explicitly set the `module` property but to a different value than
168
168
169
169
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.
170
170
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
+
171
192
### Skipping Babel
172
193
If you don't use mocks, or synthetic default imports you can skip the babel-transpilation step.
173
194
This means `jest.mock()` calls will not be hoisted to the top,
0 commit comments