简体   繁体   中英

How can I solve error when unit testing with mocha on vue?

I using mocha to do unit testing to my vuetify project

I had install it. So I run npm run test:unit , there exist error like this :

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. 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. Is that what caused this error?

I am confused to solve this error. Because all errors are located in the node-modules folder. 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 . If it is solve , done . If not I delete all node_modules folder and run npm install and rerun test command . Then my problem gone . Hope you problem can solve too ..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM