我正在开玩笑地为node.js应用程序编写一些测试。我有一个服务器server.js
和一个测试文件server.test.js
。在我server.js
我用线
var secureServer = https.createServer(options,
app).listen(config.node_port, () => {
logger.info("Service running on " + config.node_port)
});
开始我在端口8082服务器在server.test.js
我使用
var posClient = require('./pos-ClientJS.js');
要访问这些功能,我必须进行测试。运行测试时,我得到以下控制台输出:
Jest did not exit one second after the test run has completed.
This usually means that there are asynchronous operations that weren't
stopped in your tests. Consider running Jest with `--
detectOpenHandles` to troubleshoot this issue.
所以我的问题是:有没有一种方法可以停止使用javascriptstop(8082)
或sth等JavaScript代码运行服务器?还是有一种不那么困难的方法来解决此问题而不停止过程?
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句