Closed carlosrodrigues94 closed 4 years ago
what the solution?
what the solution?
On the package.json you can put a jest config, inside jest config i can add the property "moduleNameMapper" this property is used by jest to resolve the path aliases
"jest": {
"collectCoverageFrom": [
"src/functional/pages/**/*tsx",
"src/functionalcomponents/**/*tsx",
"src/functionalhooks/**/*tsx",
"src/functionalutils/**/*ts"
],
"testMatch": [
"**/__tests__/**/*.spec.tsx",
"**/__tests__/**/*.spec.ts"
],
"testPathIgnorePatterns": [
"/src/__tests__/wrapper.tsx"
],
"moduleNameMapper": {
"^~/(.*)": "<rootDir>/src/$1"
},
"verbose": true
}
I already tried so many solutions but i couldn't fix it
i will put all my configuration files here
// Error on yarn test
// config-overrides.js
// jest_config.json / i already tried with jest.config.json to/
// tsconfig.json
// tsconfig.paths.json
// package.json