While testing my api endpoints using mocha and supertest I got some of my test passing and some are not. The error message I got was uncaught error outside test suite: Uncaught error: listen EADDRINUSE:::5000
相关问题
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- Axios OPTIONS instead of POST Request. Express Res
- google-drive can't get push notifications
- How to reimport module with ES6 import
- Why is `node.js` dying when called from inside pyt
相关文章
- node连接远程oracle报错
- How can make folder with Firebase Cloud Functions
- @angular-cli install fails with deprecated request
- node.js modify file data stream?
- How to resolve hostname to an ip address in node j
- Transactionally writing files in Node.js
- Log to node console or debug during webpack build
- fetch: Getting cookies from fetch response
Even I have faced same issue. This is because supertest keep on listening port even after completing the execution of test cases. So, run the mocha command with
--exit
flag. Before runningnpm test
make sure there is no service running on the specified port