Jest and SCSS variables
问题 I'm using Jest in my project and got stuck on one test which contains SCSS variable. $grey-light: #C7C7C7; I get this Jest error: Jest encountered an unexpected token and it points on the previous mentioned line of code. 回答1: I ran into this as well and it was solved by using the identity-obj-proxy package: https://github.com/keyz/identity-obj-proxy Just follow the instructions in the Jest docs: https://jestjs.io/docs/en/webpack#mocking-css-modules And should run the tests with no issues