Skip to content

Commit cfe3338

Browse files
committed
feat(docs): Add TROUBLESHOOTING.md file
1 parent 1267105 commit cfe3338

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

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)