mocha --compilers js:babel / register"找不到模块"

时间:2016-07-22 03:16:46

标签: ecmascript-6 mocha babel

这两个链接都有关于使用带有babel编译器的mocha的教程,并且两者都不起作用,并且自2015年以来可能还没有工作:

the repository documentation

http://redux.js.org/docs/recipes/WritingTests.html

mocha --compilers js:babel/register

1 个答案:

答案 0 :(得分:10)

因为需要深入谷歌搜索才能找到解决方案。我正在制作这个SO QA。

现在是babel-core / register。

mocha --compilers js:babel-core/register

答案可以在这里找到 https://phabricator.babeljs.io/T2685

编辑:我现在看到Redux的教程有效。我在npm中输入了“脚本”,这应该是“脚本”。因此,您还可以运行以下命令:

mocha --compilers js:babel-register