-
Notifications
You must be signed in to change notification settings - Fork 455
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add Troubleshoting section (#1463)
- Loading branch information
1 parent
8b5325e
commit b8ebf36
Showing
2 changed files
with
42 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Troubleshooting | ||
|
||
## Running ts-jest on CI tools | ||
|
||
### PROBLEM | ||
|
||
Cannot find module "" from "" | ||
|
||
### SOLUTION | ||
|
||
- Check if `rootDir` is referenced correctly. If not add this on your existing jest configuration. | ||
|
||
```javascipt | ||
module.exports = { | ||
... | ||
roots: ["<rootDir>"] | ||
} | ||
``` | ||
|
||
- Check if module directories are included on your jest configuration. If not add this on your existing jest configuration. | ||
|
||
```javascipt | ||
module.exports = { | ||
... | ||
moduleDirectories: ["node_modules","<module-directory>"], | ||
modulePaths: ["<path-of-module>"], | ||
} | ||
``` | ||
|
||
- Check if module name is properly mapped and can be referenced by jest. If not, you can define moduleNameMapper for your jest configuration. | ||
|
||
```javascipt | ||
module.exports = { | ||
... | ||
moduleNameMapper: { | ||
"<import-path>": "<rootDir>/<real-physical-path>", | ||
}, | ||
} | ||
``` | ||
|
||
- 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. |