Convert your tsconfig paths to jest moduleNameMappers
.
This introduces many bug fixes and improvements to archived tsconfig-paths-jest package.
Usage
In your jest.config.js
file:
const getJestMappersFromTSConfig = ;const moduleNameMapper = ; moduleexports = moduleNameMapper // ... other configs
It assumes you have tsconfig besides your jest.config.js
file.
You can also provide the path to your tsconfig if it is in a non-standard location:
const path = ;const getJestMappersFromTSConfig = ;const tsconfigPath = path;const moduleNameMapper = ; moduleexports = moduleNameMapper // ... other configs
Options
- startsWith: ensures that all the replaced paths (keys in the tsconfig) happen at the beginning of the path. is
true
by default.