Skip to content

Commit 6a0824b

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

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

TROUBLESHOOTING.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Troubleshooting
2+
3+
This serves as a troubleshooting guide for any ts-jest related issues.
4+
5+
## Running ts-jest on CI tools
6+
7+
### PROBLEM
8+
9+
Cannot find module "" from ""
10+
11+
### SOLUTION
12+
13+
- Check if `rootDir` is referenced correctly. If not add this on your existing jest configuration.
14+
15+
```javascipt
16+
module.exports = {
17+
...
18+
roots: ["<rootDir>"]
19+
}
20+
```
21+
22+
- Check if module directories are included on your jest configuration. If not add this on your existing jest configuration.
23+
24+
```javascipt
25+
module.exports = {
26+
...
27+
moduleDirectories: ["node_modules","<module-directory>"],
28+
modulePaths: ["<path-of-module>"],
29+
}
30+
```
31+
32+
- Check if module name is properly mapped and can be referenced by jest. If not add this on your existing jest configuration.
33+
34+
```javascipt
35+
module.exports = {
36+
...
37+
moduleNameMapper: {
38+
"^.*shared/(.*)": "<rootDir>/src/shared/$1",
39+
},
40+
}
41+
```
42+
43+
- 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)