webpack alias jest code example
Example 1: webpack alias not working in jest
"jest": {
"moduleNameMapper": {
"^@root(.*)$": "<rootDir>/src$1",
"^@components(.*)$": "<rootDir>/src/components$1",
}
}
Example 2: webpack alias not working in jest
"jest": {
"moduleNameMapper": {
"^@shared(.*)$": "<rootDir>/shared$1",
"^@components(.*)$": "<rootDir>/shared/components$1"
}
},