-
-
Notifications
You must be signed in to change notification settings - Fork 198
Closed as not planned
Labels
Description
Hi, I have aliases in my webpack.config.js
.addAliases({
'~': path.resolve(__dirname, 'assets'),
'images': path.resolve(__dirname, 'assets/base/images')
})
But when I try to use module "moduleNameMapper" in package file for settings jest I have error
"jest": {
"moduleFileExtensions": [
"js",
"ts",
"json",
"vue"
],
"moduleNameMapper": {
"^~/(.*)": "<rootDir>/assets/$1"
},
"transform": {
".*\\.(vue)$": "<rootDir>/node_modules/vue-jest",
"^.+\\.js$": "<rootDir>/node_modules/babel-jest"
},
"collectCoverage": true,
"transformIgnorePatterns": [
"<rootDir>/node_modules/(?!variables/.*)"
],
"coverageReporters": [
"text",
"html"
],
"collectCoverageFrom": [
"<rootDir>/assets/src/**"
],
"testEnvironment": "jsdom"
},
**Configuration error:
Could not locate module ~/components/Modal mapped as:
/Users/Cap/Desktop/project/assets.
Please check your configuration for these entries:
{
"moduleNameMapper": {
"/^~\/(.*)$/": "/Users/Cap/Desktop/project/assets"
},
"resolver": undefined
}**
Can anyone suggest what is the problem?