Jest Path Aliases Link to heading
tsconfig
with path aliases:
{
"compilerOptions": {
"outDir": "dist",
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
}
}
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/src/$1",
},
};
- [[jest-typescript-setup|Jest Typescript Setup]]