gpt4 book ai didi

ecmascript-6 - mocha --compilers js :babel/register "cannot find module"

转载 作者:行者123 更新时间:2023-12-01 23:03:31 24 4
gpt4 key购买 nike

这两个链接都有关于将 mocha 与 babel 编译器一起使用的教程,但都不起作用,而且可能自 2015 年以来就不起作用了:

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

https://onsen.io/blog/mocha-chaijs-unit-test-coverage-es6/

mocha --compilers js:babel/register

最佳答案

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

现在是 babel-core/register。

mocha --compilers js:babel-core/register

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

编辑:我现在看到 Redux 的教程有效。我在 npm 中的“脚本”有一个错字,应该是“脚本”。因此,您还可以运行以下命令:
mocha --compilers js:babel-register

关于ecmascript-6 - mocha --compilers js :babel/register "cannot find module",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38517590/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com