這很簡單。我的JS只是呼籲:jasmine和jquery-ui - effect()方法不存在
$("#search_box").focus().effect("highlight",{},3000);
describe('initialization', function(){
beforeEach(function(){
var search_box = $("#search_box");
});
it('should initially focus on the search box', function(){
spyOn(search_box, 'focus');
wizard._initialize();
expect(search_box.focus).toHaveBeenCalled();
});
it('should initially highlight the search box', function(){
spyOn(search_box, 'effect');
wizard._initialize();
expect(search_box.effect).toHaveBeenCalledWith("highlight", {}, 3000);
});
});
focus()的作品,但效果不。它說effect()方法不存在,就好像我沒有加載jquery-ui庫。
我已經將jquery-ui添加到我的jasmine.yml文件中,並且已經驗證它是由跑步者加載的。
有什麼建議嗎?
有沒有想過這個? – 2011-12-13 02:41:38