2014-01-06 101 views
3

每當我做一個loadFixture()來電或本文下面的測試中,我得到一個錯誤,指出:茉莉花jQuery的「不確定是不是一個函數」

Frontend should be able to set fixtures. 
TypeError: undefined is not a function 
TypeError: undefined is not a function 
    at jasmine.Fixtures.cleanUp (http://localhost:4567/__spec__/helpers/jasmine-jquery.js:89:5) 
    at null.<anonymous> (http://localhost:4567/__spec__/helpers/jasmine-jquery.js:641:27) 
    at jasmine.Block.execute (http://localhost:4567/__jasmine__/jasmine.js:1064:17) 
    at jasmine.Queue.next_ (http://localhost:4567/__jasmine__/jasmine.js:2096:31) 
    at http://localhost:4567/__jasmine__/jasmine.js:2086:18 

it("should be able to set fixtures", function() { 
    expect(setFixtures).toBeDefined(); // Notice I took out the() 
}); 

茉莉花jQuery的似乎要加載,否則我得到ReferenceError: setFixtures is not defined作爲錯誤。

任何線索到底是怎麼回事?

回答

14

我發現有什麼問題。爲了將來的參考我自己回答:

我的jasmine-jquery在我的jquery文件之前加載。切換這些伎倆。

+0

非常感謝,爲我節省了很多時間! – shadowhorst

相關問題