#Jest Path Aliases Issue

6 messages · Page 1 of 1 (latest)

thin hinge
#

my jest config
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "src",
"testRegex": ".\.spec\.ts$",
"transform": {
"^.+\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/
.(t|j)s"
],
"coverageDirectory": "../coverage",
"testEnvironment": "node",
"moduleNameMapper": {
"@modules/": [
"<rootDir>/modules/
"
]
}
}

fierce salmon
#

Try

"moduleNameMapper": {
    "^@src/(.*)$": "<rootDir>/../src/$1",
}
thin hinge
#

same issue

#

tried every combination i found on google

#

then i went with vitest

#

and its working without any probem