Skip to content

Commit 02ff32e

Browse files
committed
feat(docs): Add TROUBLESHOOTING.md file
1 parent 026ef65 commit 02ff32e

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

TROUBLESHOOTING.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
Cannot find module "" from ""
9+
10+
### SOLUTION
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 add this on your existing jest configuration.
31+
32+
```javascipt
33+
module.exports = {
34+
...
35+
moduleNameMapper: {
36+
"^.*shared/(.*)": "<rootDir>/src/shared/$1",
37+
},
38+
}

0 commit comments

Comments
 (0)