diff --git a/README.md b/README.md index 570e9d2d1c..e8e51e25cb 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,7 @@ It supports all features of TypeScript including type-checking. [Read more about [ Ask for some help in the `ts-jest` community of Slack](https://bit.ly/3bRHFPQ) - +[ Before reporting any issue, be sure to check the troubleshooting page](TROUBLESHOOTING.md) [ We're looking for collaborators! Want to help improve `ts-jest`?](https://github.com/kulshekhar/ts-jest/issues/223) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md new file mode 100644 index 0000000000..27f64d9757 --- /dev/null +++ b/TROUBLESHOOTING.md @@ -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: [""] +} +``` + +- 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",""], + modulePaths: [""], +} +``` + +- 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: { + "": "/", + }, +} +``` + +- 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 ` and commit changes.