我在运行测试时收到了上述错误消息。下面是我的代码(我使用 Backbone JS 和 Jasmine 进行测试)。有谁知道为什么会这样?
$(function() {
describe("Category", function() {
beforeEach(function() {
category = new Category;
sinon.spy(jQuery, "ajax");
}
it("should fetch notes", function() {
category.set({code: 123});
category.fetchNotes();
expect(category.trigger).toHaveBeenCalled();
}
})
}