Skip to content

Commit

Permalink
Merge branch 'master' into to-dev-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
kulshekhar authored Jul 31, 2018
2 parents 0b2e406 + 4396dde commit e2028da
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,27 @@ If you *have* explicitly set the `module` property but to a different value than

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.

For example, with the below config in your tsconfig:
```
"paths": {
"@App/*": [
"src/*"
],
"@Shared/*": [
"src/Shared/*"
]
},
```

Here's what your jest config should look like:

```
"moduleNameMapper": {
"@App/(.*)": "<rootDir>/src/$1",
"@Shared/(.*)": "<rootDir>/src/Shared/$1"
}
```

### Skipping Babel
If you don't use mocks, or synthetic default imports you can skip the babel-transpilation step.
This means `jest.mock()` calls will not be hoisted to the top,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"peerDependencies": {
"babel-core": "^6.26.3 || ^7.0.0-0",
"jest": "^23.0.0 || ^24.0.0",
"typescript": "2.x"
"typescript": "^2.0.0 || ^3.0.0"
},
"devDependencies": {
"@types/babel-core": "latest",
Expand Down

0 comments on commit e2028da

Please sign in to comment.