I've been trying to set up a testing environment for my React project and I had a problem with Unexpected token when importing the CSS file. i added the moduleNameMapper to the package.json to fix it and now i'm facing this issue. Does anyone know what can i do to fix this?
> [email protected] test C:\Users\admin\Documents\myApp
> jest
FAIL _tests_\Home.test.js
● Test suite failed to run
Configuration error:
Could not locate module react-datepicker/dist/react-datepicker-cssmodules.css (mapped as identity-obj-proxy)
Please check:
"moduleNameMapper": {
"/^.+\.(css|less)$/": "identity-obj-proxy"
},
"resolver": undefined
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 1.894s
Ran all test suites.
npm ERR! Test failed. See above for more details.
jest portion of package.json
"jest": {
"transform": {
"^.+\\.jsx?$": "babel-jest"
},
"moduleNameMapper": {
"\\.(s?css|less)$": "identity-obj-proxy"
}
},