Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b8ebf36

Browse files
authoredMar 30, 2020
docs: add Troubleshoting section (#1463)
1 parent 8b5325e commit b8ebf36

File tree

2 files changed

+42
-3
lines changed

2 files changed

+42
-3
lines changed
 

‎README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ It supports all features of TypeScript including type-checking. [Read more about
1515

1616
[<img src="./docs/assets/img/slack.png" align="left" height="24"> Ask for some help in the `ts-jest` community of Slack](https://bit.ly/3bRHFPQ)
1717

18-
<!--
19-
[<img src="./docs/assets/img/troubleshooting.png" align="left" height="24"> Before reporting any issue, be sure to check the troubleshooting page](https://kulshekhar.github.io/ts-jest/user/troubleshooting)
20-
-->
18+
[<img src="./docs/assets/img/troubleshooting.png" align="left" height="24"> Before reporting any issue, be sure to check the troubleshooting page](TROUBLESHOOTING.md)
2119

2220
[<img src="./docs/assets/img/pull-request.png" align="left" height="24"> We're looking for collaborators! Want to help improve `ts-jest`?](https://github.com/kulshekhar/ts-jest/issues/223)
2321

‎TROUBLESHOOTING.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Troubleshooting
2+
3+
## Running ts-jest on CI tools
4+
5+
### PROBLEM
6+
7+
Cannot find module "" from ""
8+
9+
### SOLUTION
10+
11+
- Check if `rootDir` is referenced correctly. If not add this on your existing jest configuration.
12+
13+
```javascipt
14+
module.exports = {
15+
...
16+
roots: ["<rootDir>"]
17+
}
18+
```
19+
20+
- Check if module directories are included on your jest configuration. If not add this on your existing jest configuration.
21+
22+
```javascipt
23+
module.exports = {
24+
...
25+
moduleDirectories: ["node_modules","<module-directory>"],
26+
modulePaths: ["<path-of-module>"],
27+
}
28+
```
29+
30+
- Check if module name is properly mapped and can be referenced by jest. If not, you can define moduleNameMapper for your jest configuration.
31+
32+
```javascipt
33+
module.exports = {
34+
...
35+
moduleNameMapper: {
36+
"<import-path>": "<rootDir>/<real-physical-path>",
37+
},
38+
}
39+
```
40+
41+
- Check github folder names if its identical to you local folder names. Sometimes github never updates your folder names even if you rename it locally. If this happens rename your folders via github or use this command `git mv <source> <destination>` and commit changes.

0 commit comments

Comments
 (0)
Please sign in to comment.