【发布时间】:2015-04-16 16:18:52
【问题描述】:
是否可以在不模拟的情况下使用 $http ?发出调用的服务:
// Make the request we are interested in testing
ViewingRepositoryService.getThumbnail(obj, "urn:adsk.wipdata:versionedFile:BQLHHmlCRd-bqnr8rxF2xA?version=1", "medium")
.then(function (data) { // On success (this is what we are expecting)
console.log('success');
expect(data).to.deep.equal(mockData); //Validate the data is correct
done();
},
function (err) {
console.log('error');
done();
}
);
不显示“成功”或“错误”。
【问题讨论】:
-
只看到这个,什么也说不出来。在此处发布您的详细代码。 ViewingRepositoryService 中有什么?
-
我认为您的服务功能看起来很奇怪。我也不是很喜欢服务,但也许这tutorial 有帮助。你可以用wireshark查看网络传输
-
你能解决你的问题吗?
标签: javascript angularjs angularjs-http