File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments