UNPKG

1.09 kBMarkdownView Raw
1# Troubleshooting
2
3## Running ts-jest on CI tools
4
5### PROBLEM
6
7Cannot 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
14module.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
23module.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
33module.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.