Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

兼容新版本依赖下,运行测试用例时重复监听同一端口的问题 #166

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

CHristopherkeith
Copy link

兼容高版本环境下的测试用例

高版本环境下:
Node.js: 10.15.2
mocha: 6.1.4
should: 13.2.3
supertest: 4.0.2
express: 4.17.0

运行测试用例会占用3000端口,可能导致:
1.app已运行的情况下,会报端口已被占用的错误
2.app没有运行,测试用例运行后没有退出,继续监听端口

解决方法:
根据module.parent判断是否为运行测试用例,是的话则不监听端口

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant