How I do configure Jest to test my Angular 8 Project By default ts-jest will try to find a tsconfig.json in your project. If you'd like to use your package.json to store Jest's config, the "jest" key should be used on the top level so Jest will know how to find your settings: Here's some example output for this file: ts // @filename: index.ts. Make sure the include option in tsconfig.json includes all of your source files. If you change this setting to Auto or Non-relative, Visual Studio Code will understand how to import modules based on your tsconfig.json file. An example path looks like this: "paths": { "@shared": "src/app/shared/index.ts" } Then in a component I can use. It runs in the background after bundles are generated. There occur any errors in your IDE (in my case VSC) or when you compile the code. Paths mapping | ts-jest - GitHub Pages Docs on every TSConfig option - TypeScript How to use with Jest? · Issue #97 · dividab/tsconfig-paths - GitHub tsconfig path if you are sure the module exists, try these steps: ionic modalcontroller No component factory found for Did you add it to File C:\Users\skill\AppData\Roaming\npm\yarn.ps1 cannot be loaded because running scripts is disabled on this system. For most people, that will fix the problem. Configuring Jest · Jest { "scripts": { "start": "node -r tsconfig-paths/register -r ts-node ./src/index/ts", "build": "tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./src -o . If not, then open your settings and search for import module specifier. You'll find one for TypeScript > Preferences > Import Module Specifier. See the Modules reference page for more information. . tsconfig-paths/register jest Code Example - codegrepper.com How to mock dependency in Jest with TypeScript? Cannot find module with Application specific Tsconfig paths #738 *)$": "<rootDir>/src/$1" } Please note that this configuration (which is a simple regex) should match the tsconfig path configuration. tsconfig paths not working - NewbeDEV Everything seems to be fine, the application compiles properly and works fine as well but there's one thing that bothers me. baseUrl: Specifies where . You very likely want "CommonJS" for node projects. Jest's configuration can be defined in the package.json file of your project, or through a jest.config.js, or jest.config.ts file or through the --config <path/to/file.js|ts|cjs|mjs|json> option. Therefore, rewire resolves the module you importing without typescript functionality, only searching for the file with .js extension. So far, we've added the components alias to webpack.config.js and tsconfig.json, but since the Typescript inside our Jest tests isn't part of the same transpilation step as the rest .