Babel unexpected token import when running mocha tests

前端 未结 17 1505
Happy的楠姐
Happy的楠姐 2020-11-27 14:40

The solutions offered in other related questions, such as including the proper presets (es2015) in .babelrc, are already implemented in my project.

I have two projec

17条回答
  •  死守一世寂寞
    2020-11-27 14:55

    I had the same issue and fixed it by reading from the babel documentation for integrating Babel with Mocha :

    {
      "scripts": {
        "test": "mocha --compilers js:babel-register"
      }
    }
    

提交回复
热议问题