Syntax Error when test component with SASS file imported
You have do define a mock for this kind of file by define moduleNameMapper
in your jest settings.
We are using identity-obj-proxy
. So install it with
npm install identity-obj-proxy --save-dev
and add it your jest setting:
"moduleNameMapper": {
"^.+\\.(css|less|scss)$": "identity-obj-proxy"
}
If you have Babel in your stack, you can fix this in the right way using babel-jest
Just do npm i --save-dev babel-jest
and in your jest settings file add:
"moduleNameMapper": {
"^.+\\.(css|less|scss)$": "babel-jest"
}