您好我有工作测试
function check_getqueue(clinicID, userID) {
$.ajax({
url: siteurl+"sec_myclinic/checkingUpdates/"+clinicID+"/"+userID,
type: "POST",
dataType: "JSON",
success: function(data) {
for(var i=0;i<data.length;i++) {
var tmpCountQ = data[i]['queue_id'];
};
if (tmpCountQ < lastcountQueue) {
}
lastcountQueue = tmpCountQ;
}
});
}
在我设置
时进行下一次测试#include <iostream>
using namespace std;
int main()
{
const char* str=
"
///c++ code
for(i=0;i<5;i++)
if(i%2==0)
cout<<i;
"
const char* path="dllName.dll";
f(str,path);
return 0;
}
检查更改但有错误
错误:spyOn:val已被监视 用法:spyOn(object,methodName)
答案 0 :(得分:1)
spyObj.and.returnValue("Foo");
请注意,我使用了虚拟视图foodtype
来模仿您的观点。
var foodtype = {
addNewFoodtype: function() {
$("#newFoodtype").val("some val");
this.collection.push("some val");
},
collection: []
}
describe("multispy demo", function() {
it("should add a model", function() {
var spyObj = spyOn($.fn, "val").and.returnValue("Bar");
foodtype.addNewFoodtype(); //My view
expect($("#newFoodtype").val()).toEqual("Bar");
expect(foodtype.collection.length).toEqual(1);
spyObj.and.returnValue("Foo");
expect($("#newFoodtype").val()).toEqual("Foo");
});
});