简体   繁体   English

如何在Jasmine中调用Web服务?

[英]How can I call a web service in Jasmine?

How can I call a web services with Jasmine ? 如何使用Jasmine调用Web服务? I would like to be able to call the web service and then test and evaluate it's returned data. 我希望能够调用Web服务,然后测试和评估它的返回数据。

I think I understand the basic of how Jasmine works, the DESCRIBE and IT functions. 我想我了解Jasmine的工作原理,DESCRIBE和IT功能。 I've installed Jasmine 2.0. 我已经安装了Jasmine 2.0。 I know I have to but all my *Spec.js files into a spec directory and then launch them. 我知道我必须将所有* Spec.js文件放入一个spec目录,然后启动它们。 I just don't know how to call a web service and to evaluate to returned data from it. 我只是不知道如何调用Web服务以及评估从中返回的数据。

I still don't have access to the real web services that I will have to use so I'll need to practice on a free public web service. 我仍然无法访问将要使用的真实Web服务,因此我需要在免费的公共Web服务上进行练习。

Instead of testing the web service, you want to test the integration with the web service. 您要测试与Web服务的集成,而不是测试Web服务。 This would involve mocking calls to the web service, then you would still need manual integration testing in an environment with the full application stack. 这将涉及对Web服务的模拟调用,然后您仍然需要在具有完整应用程序堆栈的环境中进行手动集成测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM