首页 > 解决方案 > Mocha only runs one test case

问题描述

I'm using mocha to test api's created using node.js. I've written two test file and the file structure is as follows

server/
├── connect/
|   ├── test
|       |── root.spec.ts
|
└── model/
    ├──test
       ├──abc.spec.ts

The script written in package.json is as follows.

"test": "mocha server/**/**/**.spec.ts --exit"     

Now when I when I run the command npm test in the terminal inside the model directory. It shows content present inside the root.spec.ts. How do I run the abc.spec.ts i.e a single file.

标签: node.jsmocha.jschai

解决方案


推荐阅读