简体   繁体   中英

Why I am not able to use mocha through nodemon?

I am trying to run test cases using mocha framework . I am trying to run it through nodemon , but getting an error.

I have installed nodemon already through npm install nodemon and similarly with mocha . How do I run my project through nodemon so that my test cases show the result using mocha framework?

在此处输入图片说明

在此处输入图片说明

在此处输入图片说明

In the Command Prompt, my test cases are not running for whatever I do with nodemon .

Lets assume you have an entry like following in your package.json - scripts": { "start:test": "mocha test/ --recursive --exit" }

To run the mocha test using nodemon please use the following command: nodemon --exec "npm run start:test"

"test": "nodemon --exec 'mocha -R min'"

然后: npm run test

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