Jest setup “SyntaxError: Unexpected token export”

前端 未结 4 1692
迷失自我
迷失自我 2020-12-24 11:31

I\'m implementing tests into an existing project that currently has no tests. My tests are failing to compile node_modules/ imports.

/Users/me/m         


        
4条回答
  •  时光说笑
    2020-12-24 11:42

    If none of the above solutions worked for you, you can try this in your jest

    "moduleNameMapper": {
        "^lodash-es$": "lodash"
    }
    

    It will replace lodash-es with the commonjs version during testing runtime.

提交回复
热议问题