[英]How can I solve error when unit testing with mocha on vue?
I using mocha
to do unit testing to my vuetify project我使用mocha
对我的 vuetify 项目进行单元测试
I had install it.我已经安装了它。 So I run npm run test:unit
, there exist error like this :所以我运行npm run test:unit
,存在这样的错误:
npm ERR! Failed at the test-vuetify@0.1.0 test:unit script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
The full error like this :完整的错误是这样的:
How can I solve this error?我该如何解决这个错误?
Note :注意:
When I first installed vuetify and tried unit testing, it worked.当我第一次安装 vuetify 并尝试单元测试时,它奏效了。 No error没有错误
After I edited some parts and ran the unit test, the above error appeared在我编辑了一些部分并运行单元测试后,出现了上述错误
How do I resolve this error?如何解决此错误?
Update :更新:
I have updated the version of vuetify.我已经更新了 vuetify 的版本。 Is that what caused this error?这是导致此错误的原因吗?
I am confused to solve this error.我很困惑要解决这个错误。 Because all errors are located in the node-modules folder.因为所有错误都位于 node-modules 文件夹中。 Not in the component that I made不在我制作的组件中
I have got that problem often .我经常遇到这个问题。 I want to share what I do in that situation .我想分享我在那种情况下所做的事情。 I run npm update
on project folder then I rerun test command again .我在项目文件夹上运行npm update
然后我再次重新运行测试命令。 If it is solve , done .如果是解决,完成。 If not I delete all node_modules
folder and run npm install
and rerun test command .如果不是,我删除所有node_modules
文件夹并运行npm install
并重新运行 test command 。 Then my problem gone .然后我的问题消失了。 Hope you problem can solve too ..希望你的问题也能解决..
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.